{"action":"created","comment":{"url":"https://api.github.com/repos/david-caro/python-foreman/pulls/comments/25240557","id":25240557,"diff_hunk":"@@ -222,7 +247,8 @@ def __init__(self, foreman):\n         \"\"\"\n         self._f = foreman\n         # Preserve backward compatibility with old interface\n-        for method_name in ('index', 'show', 'update', 'destroy', 'create'):\n+        for method_name in ('index', 'show', 'update', 'destroy', 'create',\n+                            'search'):","path":"foreman/client.py","position":43,"original_position":43,"commit_id":"1af5ba0a327e5f8c01422ae2104317a92e4327e7","original_commit_id":"1af5ba0a327e5f8c01422ae2104317a92e4327e7","user":{"login":"iluxame","id":8256190,"avatar_url":"https://avatars.githubusercontent.com/u/8256190?v=3","gravatar_id":"","url":"https://api.github.com/users/iluxame","html_url":"https://github.com/iluxame","followers_url":"https://api.github.com/users/iluxame/followers","following_url":"https://api.github.com/users/iluxame/following{/other_user}","gists_url":"https://api.github.com/users/iluxame/gists{/gist_id}","starred_url":"https://api.github.com/users/iluxame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iluxame/subscriptions","organizations_url":"https://api.github.com/users/iluxame/orgs","repos_url":"https://api.github.com/users/iluxame/repos","events_url":"https://api.github.com/users/iluxame/events{/privacy}","received_events_url":"https://api.github.com/users/iluxame/received_events","type":"User","site_admin":false},"body":"it seems that it depends on foreman version, \r\nI tried with foreman 1.5.2:\r\n>>> from foreman import client\r\n>>> conn = client.Foreman(url=\"****\", api_version=2, auth=(\"****\", \"****\"))\r\n>>> conn.operatingsystems.index()\r\n{u'sort': {u'by': None, u'order': None}, u'search': None, u'results': [***********]}\r\n\r\nand got results","created_at":"2015-02-24T10:01:26Z","updated_at":"2015-02-24T10:01:26Z","html_url":"https://github.com/david-caro/python-foreman/pull/27#discussion_r25240557","pull_request_url":"https://api.github.com/repos/david-caro/python-foreman/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/david-caro/python-foreman/pulls/comments/25240557"},"html":{"href":"https://github.com/david-caro/python-foreman/pull/27#discussion_r25240557"},"pull_request":{"href":"https://api.github.com/repos/david-caro/python-foreman/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/david-caro/python-foreman/pulls/27","id":29879866,"html_url":"https://github.com/david-caro/python-foreman/pull/27","diff_url":"https://github.com/david-caro/python-foreman/pull/27.diff","patch_url":"https://github.com/david-caro/python-foreman/pull/27.patch","issue_url":"https://api.github.com/repos/david-caro/python-foreman/issues/27","number":27,"state":"open","locked":false,"title":"Adding support with search query","user":{"login":"avi3tal","id":2629741,"avatar_url":"https://avatars.githubusercontent.com/u/2629741?v=3","gravatar_id":"","url":"https://api.github.com/users/avi3tal","html_url":"https://github.com/avi3tal","followers_url":"https://api.github.com/users/avi3tal/followers","following_url":"https://api.github.com/users/avi3tal/following{/other_user}","gists_url":"https://api.github.com/users/avi3tal/gists{/gist_id}","starred_url":"https://api.github.com/users/avi3tal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avi3tal/subscriptions","organizations_url":"https://api.github.com/users/avi3tal/orgs","repos_url":"https://api.github.com/users/avi3tal/repos","events_url":"https://api.github.com/users/avi3tal/events{/privacy}","received_events_url":"https://api.github.com/users/avi3tal/received_events","type":"User","site_admin":false},"body":"Adding create_search_func to resource Meta class to automatically create\r\nsearch method in every Resource.\r\nSearch method will invoke \"?search=...\" built-in every resource.\r\nThe paramater is only *args which refer to list of conditions will be\r\ntranslated into search line in the same order they have bin given\r\nfire example:\r\n>>> client.hosts.search('hosts_id=1', 'mac=aa:aa:aa:aa:aa:aa')\r\n{\r\n    ..\r\n    results[..]}\r\n}\r\n\r\nNote: i haven't used **kwargs just becuse Foreman search engine\r\ninfluanced by the order of the conditions (just like in pipe command).\r\n\r\n[ticket: n/a]","created_at":"2015-02-24T08:53:22Z","updated_at":"2015-02-24T10:01:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b4f58953dfc90eadbf74e0b7af95a5fb5cee10a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/david-caro/python-foreman/pulls/27/commits","review_comments_url":"https://api.github.com/repos/david-caro/python-foreman/pulls/27/comments","review_comment_url":"https://api.github.com/repos/david-caro/python-foreman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/david-caro/python-foreman/issues/27/comments","statuses_url":"https://api.github.com/repos/david-caro/python-foreman/statuses/1af5ba0a327e5f8c01422ae2104317a92e4327e7","head":{"label":"avi3tal:add_seaech","ref":"add_seaech","sha":"1af5ba0a327e5f8c01422ae2104317a92e4327e7","user":{"login":"avi3tal","id":2629741,"avatar_url":"https://avatars.githubusercontent.com/u/2629741?v=3","gravatar_id":"","url":"https://api.github.com/users/avi3tal","html_url":"https://github.com/avi3tal","followers_url":"https://api.github.com/users/avi3tal/followers","following_url":"https://api.github.com/users/avi3tal/following{/other_user}","gists_url":"https://api.github.com/users/avi3tal/gists{/gist_id}","starred_url":"https://api.github.com/users/avi3tal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avi3tal/subscriptions","organizations_url":"https://api.github.com/users/avi3tal/orgs","repos_url":"https://api.github.com/users/avi3tal/repos","events_url":"https://api.github.com/users/avi3tal/events{/privacy}","received_events_url":"https://api.github.com/users/avi3tal/received_events","type":"User","site_admin":false},"repo":{"id":31251390,"name":"python-foreman","full_name":"avi3tal/python-foreman","owner":{"login":"avi3tal","id":2629741,"avatar_url":"https://avatars.githubusercontent.com/u/2629741?v=3","gravatar_id":"","url":"https://api.github.com/users/avi3tal","html_url":"https://github.com/avi3tal","followers_url":"https://api.github.com/users/avi3tal/followers","following_url":"https://api.github.com/users/avi3tal/following{/other_user}","gists_url":"https://api.github.com/users/avi3tal/gists{/gist_id}","starred_url":"https://api.github.com/users/avi3tal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avi3tal/subscriptions","organizations_url":"https://api.github.com/users/avi3tal/orgs","repos_url":"https://api.github.com/users/avi3tal/repos","events_url":"https://api.github.com/users/avi3tal/events{/privacy}","received_events_url":"https://api.github.com/users/avi3tal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/avi3tal/python-foreman","description":"Small low level python wrapper around Foreman API","fork":true,"url":"https://api.github.com/repos/avi3tal/python-foreman","forks_url":"https://api.github.com/repos/avi3tal/python-foreman/forks","keys_url":"https://api.github.com/repos/avi3tal/python-foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avi3tal/python-foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avi3tal/python-foreman/teams","hooks_url":"https://api.github.com/repos/avi3tal/python-foreman/hooks","issue_events_url":"https://api.github.com/repos/avi3tal/python-foreman/issues/events{/number}","events_url":"https://api.github.com/repos/avi3tal/python-foreman/events","assignees_url":"https://api.github.com/repos/avi3tal/python-foreman/assignees{/user}","branches_url":"https://api.github.com/repos/avi3tal/python-foreman/branches{/branch}","tags_url":"https://api.github.com/repos/avi3tal/python-foreman/tags","blobs_url":"https://api.github.com/repos/avi3tal/python-foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avi3tal/python-foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avi3tal/python-foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/avi3tal/python-foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avi3tal/python-foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/avi3tal/python-foreman/languages","stargazers_url":"https://api.github.com/repos/avi3tal/python-foreman/stargazers","contributors_url":"https://api.github.com/repos/avi3tal/python-foreman/contributors","subscribers_url":"https://api.github.com/repos/avi3tal/python-foreman/subscribers","subscription_url":"https://api.github.com/repos/avi3tal/python-foreman/subscription","commits_url":"https://api.github.com/repos/avi3tal/python-foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/avi3tal/python-foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/avi3tal/python-foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/avi3tal/python-foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/avi3tal/python-foreman/contents/{+path}","compare_url":"https://api.github.com/repos/avi3tal/python-foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avi3tal/python-foreman/merges","archive_url":"https://api.github.com/repos/avi3tal/python-foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avi3tal/python-foreman/downloads","issues_url":"https://api.github.com/repos/avi3tal/python-foreman/issues{/number}","pulls_url":"https://api.github.com/repos/avi3tal/python-foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/avi3tal/python-foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/avi3tal/python-foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avi3tal/python-foreman/labels{/name}","releases_url":"https://api.github.com/repos/avi3tal/python-foreman/releases{/id}","created_at":"2015-02-24T08:44:08Z","updated_at":"2015-02-24T08:44:09Z","pushed_at":"2015-02-24T08:58:26Z","git_url":"git://github.com/avi3tal/python-foreman.git","ssh_url":"git@github.com:avi3tal/python-foreman.git","clone_url":"https://github.com/avi3tal/python-foreman.git","svn_url":"https://github.com/avi3tal/python-foreman","homepage":null,"size":291,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"david-caro:master","ref":"master","sha":"586e5be76b043a792fb65d03b8a2aa999f42adb8","user":{"login":"david-caro","id":587148,"avatar_url":"https://avatars.githubusercontent.com/u/587148?v=3","gravatar_id":"","url":"https://api.github.com/users/david-caro","html_url":"https://github.com/david-caro","followers_url":"https://api.github.com/users/david-caro/followers","following_url":"https://api.github.com/users/david-caro/following{/other_user}","gists_url":"https://api.github.com/users/david-caro/gists{/gist_id}","starred_url":"https://api.github.com/users/david-caro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-caro/subscriptions","organizations_url":"https://api.github.com/users/david-caro/orgs","repos_url":"https://api.github.com/users/david-caro/repos","events_url":"https://api.github.com/users/david-caro/events{/privacy}","received_events_url":"https://api.github.com/users/david-caro/received_events","type":"User","site_admin":false},"repo":{"id":13913319,"name":"python-foreman","full_name":"david-caro/python-foreman","owner":{"login":"david-caro","id":587148,"avatar_url":"https://avatars.githubusercontent.com/u/587148?v=3","gravatar_id":"","url":"https://api.github.com/users/david-caro","html_url":"https://github.com/david-caro","followers_url":"https://api.github.com/users/david-caro/followers","following_url":"https://api.github.com/users/david-caro/following{/other_user}","gists_url":"https://api.github.com/users/david-caro/gists{/gist_id}","starred_url":"https://api.github.com/users/david-caro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-caro/subscriptions","organizations_url":"https://api.github.com/users/david-caro/orgs","repos_url":"https://api.github.com/users/david-caro/repos","events_url":"https://api.github.com/users/david-caro/events{/privacy}","received_events_url":"https://api.github.com/users/david-caro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/david-caro/python-foreman","description":"Small low level python wrapper around Foreman API","fork":false,"url":"https://api.github.com/repos/david-caro/python-foreman","forks_url":"https://api.github.com/repos/david-caro/python-foreman/forks","keys_url":"https://api.github.com/repos/david-caro/python-foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/david-caro/python-foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/david-caro/python-foreman/teams","hooks_url":"https://api.github.com/repos/david-caro/python-foreman/hooks","issue_events_url":"https://api.github.com/repos/david-caro/python-foreman/issues/events{/number}","events_url":"https://api.github.com/repos/david-caro/python-foreman/events","assignees_url":"https://api.github.com/repos/david-caro/python-foreman/assignees{/user}","branches_url":"https://api.github.com/repos/david-caro/python-foreman/branches{/branch}","tags_url":"https://api.github.com/repos/david-caro/python-foreman/tags","blobs_url":"https://api.github.com/repos/david-caro/python-foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/david-caro/python-foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/david-caro/python-foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/david-caro/python-foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/david-caro/python-foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/david-caro/python-foreman/languages","stargazers_url":"https://api.github.com/repos/david-caro/python-foreman/stargazers","contributors_url":"https://api.github.com/repos/david-caro/python-foreman/contributors","subscribers_url":"https://api.github.com/repos/david-caro/python-foreman/subscribers","subscription_url":"https://api.github.com/repos/david-caro/python-foreman/subscription","commits_url":"https://api.github.com/repos/david-caro/python-foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/david-caro/python-foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/david-caro/python-foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/david-caro/python-foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/david-caro/python-foreman/contents/{+path}","compare_url":"https://api.github.com/repos/david-caro/python-foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/david-caro/python-foreman/merges","archive_url":"https://api.github.com/repos/david-caro/python-foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/david-caro/python-foreman/downloads","issues_url":"https://api.github.com/repos/david-caro/python-foreman/issues{/number}","pulls_url":"https://api.github.com/repos/david-caro/python-foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/david-caro/python-foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/david-caro/python-foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/david-caro/python-foreman/labels{/name}","releases_url":"https://api.github.com/repos/david-caro/python-foreman/releases{/id}","created_at":"2013-10-28T00:42:05Z","updated_at":"2015-02-11T09:14:26Z","pushed_at":"2015-01-20T18:50:09Z","git_url":"git://github.com/david-caro/python-foreman.git","ssh_url":"git@github.com:david-caro/python-foreman.git","clone_url":"https://github.com/david-caro/python-foreman.git","svn_url":"https://github.com/david-caro/python-foreman","homepage":null,"size":699,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"open_issues_count":11,"forks":9,"open_issues":11,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/david-caro/python-foreman/pulls/27"},"html":{"href":"https://github.com/david-caro/python-foreman/pull/27"},"issue":{"href":"https://api.github.com/repos/david-caro/python-foreman/issues/27"},"comments":{"href":"https://api.github.com/repos/david-caro/python-foreman/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/david-caro/python-foreman/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/david-caro/python-foreman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/david-caro/python-foreman/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/david-caro/python-foreman/statuses/1af5ba0a327e5f8c01422ae2104317a92e4327e7"}}}}