{"action":"created","issue":{"url":"https://api.github.com/repos/lukecyca/pyzabbix/issues/53","labels_url":"https://api.github.com/repos/lukecyca/pyzabbix/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/lukecyca/pyzabbix/issues/53/comments","events_url":"https://api.github.com/repos/lukecyca/pyzabbix/issues/53/events","html_url":"https://github.com/lukecyca/pyzabbix/pull/53","id":57766779,"number":53,"title":"Allows do_request to accept json","user":{"login":"fpaternot","id":6155087,"avatar_url":"https://avatars.githubusercontent.com/u/6155087?v=3","gravatar_id":"","url":"https://api.github.com/users/fpaternot","html_url":"https://github.com/fpaternot","followers_url":"https://api.github.com/users/fpaternot/followers","following_url":"https://api.github.com/users/fpaternot/following{/other_user}","gists_url":"https://api.github.com/users/fpaternot/gists{/gist_id}","starred_url":"https://api.github.com/users/fpaternot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpaternot/subscriptions","organizations_url":"https://api.github.com/users/fpaternot/orgs","repos_url":"https://api.github.com/users/fpaternot/repos","events_url":"https://api.github.com/users/fpaternot/events{/privacy}","received_events_url":"https://api.github.com/users/fpaternot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-16T05:35:44Z","updated_at":"2015-02-17T01:50:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/lukecyca/pyzabbix/pulls/53","html_url":"https://github.com/lukecyca/pyzabbix/pull/53","diff_url":"https://github.com/lukecyca/pyzabbix/pull/53.diff","patch_url":"https://github.com/lukecyca/pyzabbix/pull/53.patch"},"body":"This mod allow users to switch from zabbix_api to pyzabbix without any code change at all.\r\n\r\nWithout it, they would be required to change all of their requests.\r\n\r\nEg.\r\nWith zabbix_api:\r\n```python\r\nquery = {\"output\": [\"host\"]}\r\nproxies = zapi.proxy.get(query)\r\n```\r\n\r\nWith pyzabbix 0.7.2:\r\n```python\r\nproxies = zapi.proxy.get(output=[\"host\"])\r\n```\r\n\r\nWith this patched pyzabbix:\r\nEither of both cases above will work.\r\n```python\r\nquery = {\"output\": [\"host\"]}\r\nproxies = zapi.proxy.get(query)\r\n\r\nproxies = zapi.proxy.get(output=[\"host\"])\r\n```\r\n\r\nThis change is better perceived when doing a loop call of some sort and you want to change / add / remove something on the fly from your query:\r\n```python\r\nsome_list = [\r\n    {\"description\": some_var, \"something_else\": 1 },\r\n    {\"description\": another_var, \"something_else\": 2 }\r\n]\r\nfor x in some_list:\r\n    query = {\r\n        \"description\": x['description']\r\n        ...\r\n    }\r\n    zapi.host.update(query)\r\n    if x['something_else'] == 1:\r\n        query['proxyid'] = some_var\r\n    zapi.host.update(query)\r\n```"},"comment":{"url":"https://api.github.com/repos/lukecyca/pyzabbix/issues/comments/74605450","html_url":"https://github.com/lukecyca/pyzabbix/pull/53#issuecomment-74605450","issue_url":"https://api.github.com/repos/lukecyca/pyzabbix/issues/53","id":74605450,"user":{"login":"fpaternot","id":6155087,"avatar_url":"https://avatars.githubusercontent.com/u/6155087?v=3","gravatar_id":"","url":"https://api.github.com/users/fpaternot","html_url":"https://github.com/fpaternot","followers_url":"https://api.github.com/users/fpaternot/followers","following_url":"https://api.github.com/users/fpaternot/following{/other_user}","gists_url":"https://api.github.com/users/fpaternot/gists{/gist_id}","starred_url":"https://api.github.com/users/fpaternot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpaternot/subscriptions","organizations_url":"https://api.github.com/users/fpaternot/orgs","repos_url":"https://api.github.com/users/fpaternot/repos","events_url":"https://api.github.com/users/fpaternot/events{/privacy}","received_events_url":"https://api.github.com/users/fpaternot/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T01:50:15Z","updated_at":"2015-02-17T01:50:15Z","body":"Hello folks,\n\nActually Luke's reply helped me a lot in order to fix the issue i was had\nand without any bit to change at all with current implementation of\npyzabbix.\n\nSorry for the trouble and thanks for the help provided :D\n\nTake care,\n\n\n--\nAtt.\nFilipe Paternot\n\nOn Mon, Feb 16, 2015 at 2:40 PM, GpMidi <notifications@github.com> wrote:\n\n> Perhaps @fpaternot <https://github.com/fpaternot> could write a separate\n> module that is backwards compatible but proxies the requests back to\n> pyzabbix.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/lukecyca/pyzabbix/pull/53#issuecomment-74536526>.\n>\n"}}