{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/82644497","pull_request_review_id":3537849,"id":82644497,"diff_hunk":"@@ -1,8 +1,118 @@\n class ManageIQ::Providers::Openstack::CloudManager::HostAggregate < ::HostAggregate\n+  include SupportsFeatureMixin\n+\n+  supports :update_aggregate\n+  supports :delete_aggregate\n+  supports :add_host\n+  supports :remove_host\n+\n   store :metadata, :accessors => [:availability_zone]\n \n   # if availability zone named in metadata exists, return it\n   def availability_zone_obj\n     AvailabilityZone.find_by_ems_ref_and_ems_id(availability_zone, ems_id)\n   end\n+\n+  def self.create_aggregate(ext_management_system, options)\n+    raise ArgumentError, _(\"ext_management_system cannot be nil\") if ext_management_system.nil?\n+\n+    create_args = {:name => options[:name]}\n+    if options[:availability_zone]\n+      create_args[:availability_zone] = options[:availability_zone]\n+    end\n+    aggregate = nil\n+    metadata = {}\n+\n+    connection_options = {:service => \"Compute\"}\n+    ext_management_system.with_provider_connection(connection_options) do |service|\n+      aggregate = service.aggregates.create(create_args)\n+      if aggregate.availability_zone\n+        metadata[:availability_zone] = aggregate.availability_zone\n+      end\n+    end\n+    create(:name                  => options[:name],\n+           :ems_ref               => aggregate.id,\n+           :metadata              => metadata,\n+           :ext_management_system => ext_management_system)\n+  rescue => e\n+    _log.error \"host_aggregate=[#{options[:name]}], error: #{e}\"\n+    raise MiqException::MiqHostAggregateCreateError, e.to_s, e.backtrace\n+  end\n+\n+  def external_aggregate\n+    connection_options = { :service => \"Compute\" }\n+    ext_management_system.with_provider_connection(connection_options) do |service|\n+      service.aggregates.get(ems_ref)\n+    end\n+  end\n+\n+  def update_aggregate(options)\n+    unless options[:name].blank?\n+      rename_aggregate(options[:name])\n+    end\n+\n+    if options[:metadata]\n+      update_aggregate_metadata(options[:metadata])\n+    end\n+  end\n+\n+  def rename_aggregate(new_name)","path":"app/models/manageiq/providers/openstack/cloud_manager/host_aggregate.rb","position":58,"original_position":59,"commit_id":"27f8fe774faf2dd2461597821fddf5d4c01af8ad","original_commit_id":"91c35b3f949c38cd8faf4a04165b5d8be0826440","user":{"login":"sseago","id":1120000,"avatar_url":"https://avatars.githubusercontent.com/u/1120000?v=3","gravatar_id":"","url":"https://api.github.com/users/sseago","html_url":"https://github.com/sseago","followers_url":"https://api.github.com/users/sseago/followers","following_url":"https://api.github.com/users/sseago/following{/other_user}","gists_url":"https://api.github.com/users/sseago/gists{/gist_id}","starred_url":"https://api.github.com/users/sseago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sseago/subscriptions","organizations_url":"https://api.github.com/users/sseago/orgs","repos_url":"https://api.github.com/users/sseago/repos","events_url":"https://api.github.com/users/sseago/events{/privacy}","received_events_url":"https://api.github.com/users/sseago/received_events","type":"User","site_admin":false},"body":"@durandom So the difference here is that before I used SupportsFeatureMixin there was a separate internal only method in the subclass called by the one without raw in the superclass. Now that we're using SupportsFeatureMixin, there's nothing in the superclass, so the provider-specific subclass just has one method, the externally-facing one, which does what the prior iteration of the raw method did.","created_at":"2016-10-10T17:08:46Z","updated_at":"2016-10-10T17:08:47Z","html_url":"https://github.com/ManageIQ/manageiq/pull/11580#discussion_r82644497","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11580","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/82644497"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/11580#discussion_r82644497"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11580"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11580","id":87317418,"html_url":"https://github.com/ManageIQ/manageiq/pull/11580","diff_url":"https://github.com/ManageIQ/manageiq/pull/11580.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/11580.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/11580","number":11580,"state":"open","locked":false,"title":"CRUD for OpenStack Host Aggregates","user":{"login":"sseago","id":1120000,"avatar_url":"https://avatars.githubusercontent.com/u/1120000?v=3","gravatar_id":"","url":"https://api.github.com/users/sseago","html_url":"https://github.com/sseago","followers_url":"https://api.github.com/users/sseago/followers","following_url":"https://api.github.com/users/sseago/following{/other_user}","gists_url":"https://api.github.com/users/sseago/gists{/gist_id}","starred_url":"https://api.github.com/users/sseago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sseago/subscriptions","organizations_url":"https://api.github.com/users/sseago/orgs","repos_url":"https://api.github.com/users/sseago/repos","events_url":"https://api.github.com/users/sseago/events{/privacy}","received_events_url":"https://api.github.com/users/sseago/received_events","type":"User","site_admin":false},"body":"API calls for creating, editing, deleting, and adding/removing hosts\r\nfor OpenStack Host Aggregates","created_at":"2016-09-29T13:52:42Z","updated_at":"2016-10-10T17:08:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e073ad2aad8dc704d80a818ef2213b5ad6ef1b52","assignee":{"login":"tzumainn","id":1280178,"avatar_url":"https://avatars.githubusercontent.com/u/1280178?v=3","gravatar_id":"","url":"https://api.github.com/users/tzumainn","html_url":"https://github.com/tzumainn","followers_url":"https://api.github.com/users/tzumainn/followers","following_url":"https://api.github.com/users/tzumainn/following{/other_user}","gists_url":"https://api.github.com/users/tzumainn/gists{/gist_id}","starred_url":"https://api.github.com/users/tzumainn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzumainn/subscriptions","organizations_url":"https://api.github.com/users/tzumainn/orgs","repos_url":"https://api.github.com/users/tzumainn/repos","events_url":"https://api.github.com/users/tzumainn/events{/privacy}","received_events_url":"https://api.github.com/users/tzumainn/received_events","type":"User","site_admin":false},"assignees":[{"login":"tzumainn","id":1280178,"avatar_url":"https://avatars.githubusercontent.com/u/1280178?v=3","gravatar_id":"","url":"https://api.github.com/users/tzumainn","html_url":"https://github.com/tzumainn","followers_url":"https://api.github.com/users/tzumainn/followers","following_url":"https://api.github.com/users/tzumainn/following{/other_user}","gists_url":"https://api.github.com/users/tzumainn/gists{/gist_id}","starred_url":"https://api.github.com/users/tzumainn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzumainn/subscriptions","organizations_url":"https://api.github.com/users/tzumainn/orgs","repos_url":"https://api.github.com/users/tzumainn/repos","events_url":"https://api.github.com/users/tzumainn/events{/privacy}","received_events_url":"https://api.github.com/users/tzumainn/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11580/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11580/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/11580/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/27f8fe774faf2dd2461597821fddf5d4c01af8ad","head":{"label":"sseago:aggregate-crud","ref":"aggregate-crud","sha":"27f8fe774faf2dd2461597821fddf5d4c01af8ad","user":{"login":"sseago","id":1120000,"avatar_url":"https://avatars.githubusercontent.com/u/1120000?v=3","gravatar_id":"","url":"https://api.github.com/users/sseago","html_url":"https://github.com/sseago","followers_url":"https://api.github.com/users/sseago/followers","following_url":"https://api.github.com/users/sseago/following{/other_user}","gists_url":"https://api.github.com/users/sseago/gists{/gist_id}","starred_url":"https://api.github.com/users/sseago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sseago/subscriptions","organizations_url":"https://api.github.com/users/sseago/orgs","repos_url":"https://api.github.com/users/sseago/repos","events_url":"https://api.github.com/users/sseago/events{/privacy}","received_events_url":"https://api.github.com/users/sseago/received_events","type":"User","site_admin":false},"repo":{"id":27775329,"name":"manageiq","full_name":"sseago/manageiq","owner":{"login":"sseago","id":1120000,"avatar_url":"https://avatars.githubusercontent.com/u/1120000?v=3","gravatar_id":"","url":"https://api.github.com/users/sseago","html_url":"https://github.com/sseago","followers_url":"https://api.github.com/users/sseago/followers","following_url":"https://api.github.com/users/sseago/following{/other_user}","gists_url":"https://api.github.com/users/sseago/gists{/gist_id}","starred_url":"https://api.github.com/users/sseago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sseago/subscriptions","organizations_url":"https://api.github.com/users/sseago/orgs","repos_url":"https://api.github.com/users/sseago/repos","events_url":"https://api.github.com/users/sseago/events{/privacy}","received_events_url":"https://api.github.com/users/sseago/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sseago/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/sseago/manageiq","forks_url":"https://api.github.com/repos/sseago/manageiq/forks","keys_url":"https://api.github.com/repos/sseago/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sseago/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sseago/manageiq/teams","hooks_url":"https://api.github.com/repos/sseago/manageiq/hooks","issue_events_url":"https://api.github.com/repos/sseago/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/sseago/manageiq/events","assignees_url":"https://api.github.com/repos/sseago/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/sseago/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/sseago/manageiq/tags","blobs_url":"https://api.github.com/repos/sseago/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sseago/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sseago/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/sseago/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sseago/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/sseago/manageiq/languages","stargazers_url":"https://api.github.com/repos/sseago/manageiq/stargazers","contributors_url":"https://api.github.com/repos/sseago/manageiq/contributors","subscribers_url":"https://api.github.com/repos/sseago/manageiq/subscribers","subscription_url":"https://api.github.com/repos/sseago/manageiq/subscription","commits_url":"https://api.github.com/repos/sseago/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/sseago/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/sseago/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/sseago/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/sseago/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/sseago/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sseago/manageiq/merges","archive_url":"https://api.github.com/repos/sseago/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sseago/manageiq/downloads","issues_url":"https://api.github.com/repos/sseago/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/sseago/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/sseago/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/sseago/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sseago/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/sseago/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/sseago/manageiq/deployments","created_at":"2014-12-09T16:21:19Z","updated_at":"2016-03-15T03:42:05Z","pushed_at":"2016-10-10T14:50:04Z","git_url":"git://github.com/sseago/manageiq.git","ssh_url":"git@github.com:sseago/manageiq.git","clone_url":"https://github.com/sseago/manageiq.git","svn_url":"https://github.com/sseago/manageiq","homepage":"manageiq.org","size":159996,"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":"ManageIQ:master","ref":"master","sha":"ca48613c71255ba6045904323c1ebb09d75ed842","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"name":"manageiq","full_name":"ManageIQ/manageiq","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Open-Source Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/ManageIQ/manageiq/deployments","created_at":"2014-06-13T02:31:26Z","updated_at":"2016-10-07T20:22:27Z","pushed_at":"2016-10-10T17:08:35Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":210043,"stargazers_count":335,"watchers_count":335,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":361,"mirror_url":null,"open_issues_count":832,"forks":361,"open_issues":832,"watchers":335,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11580"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/11580"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/11580"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/11580/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11580/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11580/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/27f8fe774faf2dd2461597821fddf5d4c01af8ad"}}}}
{"actor":{"display_login":"sseago"}}