{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-client/pulls/comments/42641994","id":42641994,"diff_hunk":"@@ -0,0 +1,173 @@\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+module Crowbar\n+  module Client\n+    module Command\n+      module Network\n+        extend ActiveSupport::Concern\n+\n+        included do\n+          desc \"Network specific commands\"\n+          command :network do |parent|\n+            parent.desc \"Actions for virtual IP addresses\"\n+            parent.command :virtual do |c|\n+              c.desc \"Allocate virtual IP address\"\n+              c.arg :name\n+              c.arg :service\n+              c.arg :network\n+              c.arg :range\n+              c.arg :suggestion, :optional\n+              c.command :allocate do |a|\n+                a.action do |global, opts, args|\n+                  name = args.shift\n+                  service = args.shift\n+                  network = args.shift\n+                  range = args.shift\n+                  suggestion = args.shift || \"\"\n+\n+                  Request.instance.network_allocate_virtual(name, service, network, range, suggestion) do |request|\n+                    case request.code\n+                    when 200\n+                      say JSON.pretty_generate(request.parsed_response)\n+                    else\n+                      exit_now! request.parsed_response[\"error\"]\n+                    end\n+                  end\n+                end\n+              end\n+\n+              c.desc \"Deallocate virtual IP address\"\n+              c.arg :name\n+              c.arg :service\n+              c.arg :network\n+              c.command :deallocate do |a|\n+                a.action do |global, opts, args|\n+                  name = args.shift\n+                  service = args.shift\n+                  network = args.shift\n+\n+                  Request.instance.network_deallocate_virtual(name, service, networkn) do |request|\n+                    case request.code\n+                    when 200\n+                      say \"Successfully deallocated the IP\"\n+                    else\n+                      exit_now! request.parsed_response[\"error\"]\n+                    end\n+                  end\n+                end\n+              end\n+            end\n+\n+            parent.desc \"Actions for real IP addresses\"\n+            parent.command :ip do |c|\n+              c.desc \"Allocate real IP address\"\n+              c.arg :name\n+              c.arg :node\n+              c.arg :network\n+              c.arg :range\n+              c.arg :suggestion, :optional\n+              c.command :allocate do |a|\n+                a.action do |global, opts, args|\n+                  name = args.shift\n+                  node = args.shift\n+                  network = args.shift\n+                  range = args.shift\n+                  suggestion = args.shift || \"\"\n+\n+                  Request.instance.network_allocate_ip(name, node, network, range, suggestion) do |request|\n+                    case request.code\n+                    when 200\n+                      say JSON.pretty_generate(request.parsed_response)\n+                    else\n+                      exit_now! request.parsed_response[\"error\"]\n+                    end\n+                  end\n+                end\n+              end\n+\n+              c.desc \"Deallocate real IP address\"\n+              c.arg :name\n+              c.arg :node\n+              c.arg :network\n+              c.command :deallocate do |a|\n+                a.action do |global, opts, args|\n+                  name = args.shift\n+                  node = args.shift\n+                  network = args.shift\n+\n+                  Request.instance.network_deallocate_ip(name, node, network) do |request|\n+                    case request.code\n+                    when 200\n+                      say \"Successfully deallocated the IP\"\n+                    else\n+                      exit_now! request.parsed_response[\"error\"]\n+                    end\n+                  end\n+                end\n+              end\n+            end\n+\n+            parent.desc \"Actions for network interfaces\"\n+            parent.command :interface do |c|\n+              c.desc \"Enable a network interface\"\n+              c.arg :name\n+              c.arg :node\n+              c.arg :network\n+              c.command :enable do |a|\n+                a.action do |global, opts, args|\n+                  name = args.shift\n+                  node = args.shift\n+                  network = args.shift\n+\n+                  Request.instance.network_enable_interface(name, node, network) do |request|\n+                    case request.code\n+                    when 200\n+                      say JSON.pretty_generate(request.parsed_response)\n+                    else\n+                      exit_now! request.parsed_response[\"error\"]\n+                    end\n+                  end\n+                end\n+              end\n+\n+              c.desc \"Disable a network interface\"\n+              c.arg :name\n+              c.arg :node\n+              c.arg :network\n+              c.command :disable do |a|\n+                a.action do |global, opts, args|\n+                  name = args.shift\n+                  node = args.shift\n+                  network = args.shift\n+\n+                  Request.instance.network_disable_interface(name, node, network) do |request|","path":"lib/crowbar/client/command/network.rb","position":157,"original_position":157,"commit_id":"93a7858d3a11f4c983cbe6d593f9a35421fe9c8b","original_commit_id":"93a7858d3a11f4c983cbe6d593f9a35421fe9c8b","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [94/80]","created_at":"2015-10-21T15:48:15Z","updated_at":"2015-10-21T15:48:15Z","html_url":"https://github.com/crowbar/crowbar-client/pull/10#discussion_r42641994","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-client/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-client/pulls/comments/42641994"},"html":{"href":"https://github.com/crowbar/crowbar-client/pull/10#discussion_r42641994"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-client/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-client/pulls/10","id":48350015,"html_url":"https://github.com/crowbar/crowbar-client/pull/10","diff_url":"https://github.com/crowbar/crowbar-client/pull/10.diff","patch_url":"https://github.com/crowbar/crowbar-client/pull/10.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-client/issues/10","number":10,"state":"open","locked":false,"title":"Implemented all required network subcommands","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":"The code is currently not DRY and I have not integrated tests yet. Hopefully we can take some time afterwards to reduce the duplication and to make it really rocksolid with tests.\r\n\r\n**This depends on https://github.com/crowbar/crowbar-core/pull/95**","created_at":"2015-10-21T15:48:03Z","updated_at":"2015-10-21T15:48:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24191607bf12251685a6bee2a475c9351dc4c30c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-client/pulls/10/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-client/pulls/10/comments","review_comment_url":"https://api.github.com/repos/crowbar/crowbar-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowbar/crowbar-client/issues/10/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-client/statuses/93a7858d3a11f4c983cbe6d593f9a35421fe9c8b","head":{"label":"tboerger:feature/network","ref":"feature/network","sha":"93a7858d3a11f4c983cbe6d593f9a35421fe9c8b","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},"repo":{"id":44047963,"name":"crowbar-client","full_name":"tboerger/crowbar-client","owner":{"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},"private":false,"html_url":"https://github.com/tboerger/crowbar-client","description":"Command line client for Crowbar","fork":true,"url":"https://api.github.com/repos/tboerger/crowbar-client","forks_url":"https://api.github.com/repos/tboerger/crowbar-client/forks","keys_url":"https://api.github.com/repos/tboerger/crowbar-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tboerger/crowbar-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tboerger/crowbar-client/teams","hooks_url":"https://api.github.com/repos/tboerger/crowbar-client/hooks","issue_events_url":"https://api.github.com/repos/tboerger/crowbar-client/issues/events{/number}","events_url":"https://api.github.com/repos/tboerger/crowbar-client/events","assignees_url":"https://api.github.com/repos/tboerger/crowbar-client/assignees{/user}","branches_url":"https://api.github.com/repos/tboerger/crowbar-client/branches{/branch}","tags_url":"https://api.github.com/repos/tboerger/crowbar-client/tags","blobs_url":"https://api.github.com/repos/tboerger/crowbar-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tboerger/crowbar-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tboerger/crowbar-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/tboerger/crowbar-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tboerger/crowbar-client/statuses/{sha}","languages_url":"https://api.github.com/repos/tboerger/crowbar-client/languages","stargazers_url":"https://api.github.com/repos/tboerger/crowbar-client/stargazers","contributors_url":"https://api.github.com/repos/tboerger/crowbar-client/contributors","subscribers_url":"https://api.github.com/repos/tboerger/crowbar-client/subscribers","subscription_url":"https://api.github.com/repos/tboerger/crowbar-client/subscription","commits_url":"https://api.github.com/repos/tboerger/crowbar-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/tboerger/crowbar-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/tboerger/crowbar-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/tboerger/crowbar-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/tboerger/crowbar-client/contents/{+path}","compare_url":"https://api.github.com/repos/tboerger/crowbar-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tboerger/crowbar-client/merges","archive_url":"https://api.github.com/repos/tboerger/crowbar-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tboerger/crowbar-client/downloads","issues_url":"https://api.github.com/repos/tboerger/crowbar-client/issues{/number}","pulls_url":"https://api.github.com/repos/tboerger/crowbar-client/pulls{/number}","milestones_url":"https://api.github.com/repos/tboerger/crowbar-client/milestones{/number}","notifications_url":"https://api.github.com/repos/tboerger/crowbar-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tboerger/crowbar-client/labels{/name}","releases_url":"https://api.github.com/repos/tboerger/crowbar-client/releases{/id}","created_at":"2015-10-11T10:31:42Z","updated_at":"2015-10-11T10:31:43Z","pushed_at":"2015-10-21T15:46:42Z","git_url":"git://github.com/tboerger/crowbar-client.git","ssh_url":"git@github.com:tboerger/crowbar-client.git","clone_url":"https://github.com/tboerger/crowbar-client.git","svn_url":"https://github.com/tboerger/crowbar-client","homepage":"","size":118,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"crowbar:master","ref":"master","sha":"83929e819bc405562b2d18588c4c8f1c4f5149b3","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":39223531,"name":"crowbar-client","full_name":"crowbar/crowbar-client","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-client","description":"Command line client for Crowbar","fork":false,"url":"https://api.github.com/repos/crowbar/crowbar-client","forks_url":"https://api.github.com/repos/crowbar/crowbar-client/forks","keys_url":"https://api.github.com/repos/crowbar/crowbar-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/crowbar-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/crowbar-client/teams","hooks_url":"https://api.github.com/repos/crowbar/crowbar-client/hooks","issue_events_url":"https://api.github.com/repos/crowbar/crowbar-client/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/crowbar-client/events","assignees_url":"https://api.github.com/repos/crowbar/crowbar-client/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/crowbar-client/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/crowbar-client/tags","blobs_url":"https://api.github.com/repos/crowbar/crowbar-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/crowbar-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/crowbar-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/crowbar-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/crowbar-client/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/crowbar-client/languages","stargazers_url":"https://api.github.com/repos/crowbar/crowbar-client/stargazers","contributors_url":"https://api.github.com/repos/crowbar/crowbar-client/contributors","subscribers_url":"https://api.github.com/repos/crowbar/crowbar-client/subscribers","subscription_url":"https://api.github.com/repos/crowbar/crowbar-client/subscription","commits_url":"https://api.github.com/repos/crowbar/crowbar-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/crowbar-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/crowbar-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/crowbar-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowbar/crowbar-client/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/crowbar-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/crowbar-client/merges","archive_url":"https://api.github.com/repos/crowbar/crowbar-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/crowbar-client/downloads","issues_url":"https://api.github.com/repos/crowbar/crowbar-client/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/crowbar-client/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/crowbar-client/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/crowbar-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/crowbar-client/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/crowbar-client/releases{/id}","created_at":"2015-07-16T22:29:43Z","updated_at":"2015-08-20T13:44:23Z","pushed_at":"2015-10-21T15:48:03Z","git_url":"git://github.com/crowbar/crowbar-client.git","ssh_url":"git@github.com:crowbar/crowbar-client.git","clone_url":"https://github.com/crowbar/crowbar-client.git","svn_url":"https://github.com/crowbar/crowbar-client","homepage":"","size":194,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":8,"forks":5,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-client/pulls/10"},"html":{"href":"https://github.com/crowbar/crowbar-client/pull/10"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-client/issues/10"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-client/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-client/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/crowbar-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowbar/crowbar-client/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-client/statuses/93a7858d3a11f4c983cbe6d593f9a35421fe9c8b"}}}}