{"action":"closed","issue":{"url":"https://api.github.com/repos/PaloAltoNetworks/pancloud/issues/21","repository_url":"https://api.github.com/repos/PaloAltoNetworks/pancloud","labels_url":"https://api.github.com/repos/PaloAltoNetworks/pancloud/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/PaloAltoNetworks/pancloud/issues/21/comments","events_url":"https://api.github.com/repos/PaloAltoNetworks/pancloud/issues/21/events","html_url":"https://github.com/PaloAltoNetworks/pancloud/issues/21","id":318947679,"number":21,"title":"Enhancement: poll_all() and iter_poll() improved loop control","user":{"login":"btorresgil","id":4164289,"avatar_url":"https://avatars2.githubusercontent.com/u/4164289?v=4","gravatar_id":"","url":"https://api.github.com/users/btorresgil","html_url":"https://github.com/btorresgil","followers_url":"https://api.github.com/users/btorresgil/followers","following_url":"https://api.github.com/users/btorresgil/following{/other_user}","gists_url":"https://api.github.com/users/btorresgil/gists{/gist_id}","starred_url":"https://api.github.com/users/btorresgil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btorresgil/subscriptions","organizations_url":"https://api.github.com/users/btorresgil/orgs","repos_url":"https://api.github.com/users/btorresgil/repos","events_url":"https://api.github.com/users/btorresgil/events{/privacy}","received_events_url":"https://api.github.com/users/btorresgil/received_events","type":"User","site_admin":false},"labels":[{"id":869796666,"url":"https://api.github.com/repos/PaloAltoNetworks/pancloud/labels/bug","name":"bug","color":"d73a4a","default":true}],"state":"closed","locked":false,"assignee":{"login":"sserrata","id":9343811,"avatar_url":"https://avatars0.githubusercontent.com/u/9343811?v=4","gravatar_id":"","url":"https://api.github.com/users/sserrata","html_url":"https://github.com/sserrata","followers_url":"https://api.github.com/users/sserrata/followers","following_url":"https://api.github.com/users/sserrata/following{/other_user}","gists_url":"https://api.github.com/users/sserrata/gists{/gist_id}","starred_url":"https://api.github.com/users/sserrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sserrata/subscriptions","organizations_url":"https://api.github.com/users/sserrata/orgs","repos_url":"https://api.github.com/users/sserrata/repos","events_url":"https://api.github.com/users/sserrata/events{/privacy}","received_events_url":"https://api.github.com/users/sserrata/received_events","type":"User","site_admin":false},"assignees":[{"login":"sserrata","id":9343811,"avatar_url":"https://avatars0.githubusercontent.com/u/9343811?v=4","gravatar_id":"","url":"https://api.github.com/users/sserrata","html_url":"https://github.com/sserrata","followers_url":"https://api.github.com/users/sserrata/followers","following_url":"https://api.github.com/users/sserrata/following{/other_user}","gists_url":"https://api.github.com/users/sserrata/gists{/gist_id}","starred_url":"https://api.github.com/users/sserrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sserrata/subscriptions","organizations_url":"https://api.github.com/users/sserrata/orgs","repos_url":"https://api.github.com/users/sserrata/repos","events_url":"https://api.github.com/users/sserrata/events{/privacy}","received_events_url":"https://api.github.com/users/sserrata/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-04-30T16:14:20Z","updated_at":"2018-05-04T16:10:26Z","closed_at":"2018-05-04T16:10:26Z","author_association":"OWNER","body":"* Palo Alto Networks Cloud Python SDK version: 1.0.3\r\n\r\n### Description\r\n\r\nCurrently the `poll_all()` and `iter_poll()` methods loop through all the pages of results until the last page is found.  There are two suggestions for improvements to allow better control of this loop:\r\n\r\n#### Suggestion 1:\r\n\r\nAdd a `timeout=` keyword argument with a sensible default.  This would act as a timeout for the whole operation which allows a developer to restrict how long a poll job can run.  This can be done currently with `iter_poll()` where the developer manages their own timeout, but we can make it easier by adding the argument.\r\n\r\n#### Suggestion 2:\r\n\r\nCurrently, the loop uses `else` to assume the query status is `RUNNING`. This could result in an infinite loop if the API changes or fails. To better future-proof the library, check for `RUNNING` explicitly and use `else` to raise an exception such as `Unexpected query status: {}`."}}
{"actor":{"display_login":"sserrata"}}