-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to iterate over the entire results of policy_states.list_query_results_for_subscription. #17280
Comments
thanks for the feedback! we'll investigate this asap. |
@00Kai0 please provide help on the issue |
This issue happened because next link using wrong method. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @kenieva. Issue Details
Describe the bug After instantiating
Only the first 1000 policy state results are listed and when the client goes on to fetch the next 1000 results it errors out with the above exception. The issue is happening because the Policy States List API (https://docs.microsoft.com/en-us/rest/api/policy/policystates/listqueryresultsforsubscription) expects the URL returned by The problem seems to in line, Line 139 in 447e6f7
Things start to work, on changing the line from To Reproduce
Expected behavior
|
Fix swagger PR :Azure/azure-rest-api-specs#14035 |
@ietashish I am following to know if your issue is resolved ? Please let us know. |
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
New API spec for peering microsoft.peering 2022 01 01 (Azure#17280) * Adding 2022-01-01 version for Peering * update Peering spec for 2022-01-01 * updating 2022-01-01 Peering spec * update swagger examples * Adds base for updating Microsoft.Peering from version stable/2021-06-01 to version 2022-01-01 * Updates readme * Updates API version in new specs and examples * Creating new API spec version 2022-01-01 for Peering * Fix staging lint issues * update as per comment - updating x-ms-enum names Co-authored-by: Sridharan J <srij@microsoft.com>
Describe the bug
The issue happens when trying to list the policy state of entire subscription.
After instantiating
PolicyInsightsClient
and iterating over the results returned byclient.policy_states.list_query_results_for_subscription(...)
, the following exception is thrownOnly the first 1000 policy state results are listed and when the client goes on to fetch the next 1000 results it errors out with the above exception.
The issue is happening because the Policy States List API (https://docs.microsoft.com/en-us/rest/api/policy/policystates/listqueryresultsforsubscription) expects the URL returned by
@odata.nextLink
attribute to be called over POST and not GET.The problem seems to in line,
azure-sdk-for-python/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_states_operations.py
Line 139 in 447e6f7
Things start to work, on changing the line from
request = self._client.get(url, query_parameters, header_parameters)
to
request = self._client.post(url, query_parameters, header_parameters)
To Reproduce
Steps to reproduce the behavior:
pip install azure-mgmt-policyinsights
(latest version which is 1.0.0)NOTE: Make sure that the subscription this is tried upon has more than 1000 policy state results.
Expected behavior
One should be able to iterate over the entire list of policy states.
The text was updated successfully, but these errors were encountered: