Skip to content
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

Fix to support nextLink with post calls for python sdk #14035

Merged
merged 20 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"parameters": {
"api-version": "2019-10-01",
"$skiptoken": "WpmWfBSvPhkAK6QD",
"nextLink": "{nextLink}"
},
"responses": {
"200": {
"body": {
"@odata.nextLink": null,
"@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default",
"@odata.count": 2,
"value": [
{
"@odata.id": null,
"@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
"timestamp": "2018-02-07T22:19:18.8896095Z",
"resourceId": "/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myrg/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/DAExtension",
"policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/1ef5d536aec743a0aa801c1a",
"policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
"effectiveParameters": null,
"isCompliant": false,
"subscriptionId": "fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef",
"resourceType": "/Microsoft.Compute/virtualMachines/extensions",
"resourceLocation": "westeurope",
"resourceGroup": "myrg",
"resourceTags": "tbd",
"policyAssignmentName": "1ef5d536aec743a0aa801c1a",
"policyAssignmentOwner": "tbd",
"policyAssignmentParameters": "{}",
"policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
"policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
"policyDefinitionAction": "audit",
"policyDefinitionCategory": "tbd",
"policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/335cefd2-ab16-430f-b364-974a170eb1d5",
"policySetDefinitionName": "335cefd2-ab16-430f-b364-974a170eb1d5",
"policySetDefinitionOwner": null,
"policySetDefinitionCategory": null,
"policySetDefinitionParameters": null,
"managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
"policyDefinitionReferenceId": "15521232277412542086",
"tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
"principalOid": "fff3e452-fff2-fff1-fff8-fff12618f1b8",
"complianceState": "NonCompliant"
},
{
"@odata.id": null,
"@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity",
"timestamp": "2018-02-07T22:19:18.8896095Z",
"resourceId": "/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myrg/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/DAExtension",
"policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/95816fce53454b15a7ed803d",
"policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/a2c0414b-82e4-459d-97d5-94c79a89232c",
"effectiveParameters": null,
"isCompliant": false,
"subscriptionId": "fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef",
"resourceType": "/Microsoft.Compute/virtualMachines/extensions",
"resourceLocation": "westeurope",
"resourceGroup": "myrg",
"resourceTags": "tbd",
"policyAssignmentName": "95816fce53454b15a7ed803d",
"policyAssignmentOwner": "tbd",
"policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"eastus\"]}}",
"policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
"policyDefinitionName": "a2c0414b-82e4-459d-97d5-94c79a89232c",
"policyDefinitionAction": "audit",
"policyDefinitionCategory": "tbd",
"policySetDefinitionId": "",
"policySetDefinitionName": "",
"policySetDefinitionOwner": null,
"policySetDefinitionCategory": null,
"policySetDefinitionParameters": null,
"managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
"policyDefinitionReferenceId": "",
"tenantId": "fff988bf-fff1-ffff-fffb-fffcd011db47",
"principalOid": "fff3e452-fff2-fff1-fff8-fff12618f1b8",
"complianceState": "NonCompliant"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"parameters": {
"api-version": "2019-10-01",
"$skiptoken": "WpmghrfhqlwpqqdrwpwmgWfBSvPhkAK6QD",
"nextLink": "{nextLink}"
},
"responses": {
"200": {
"body": {
"@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
"@odata.count": 2,
"value": [
{
"@odata.id": null,
"@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
"timestamp": "2019-10-09T17:41:47Z",
"resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/microsoft.insights/autoscalesettings/mytest1",
"policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/1ef5d536aec743a0aa801c1a",
"policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
"effectiveParameters": null,
"isCompliant": false,
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
"resourceType": "/microsoft.insights/autoscalesettings",
"resourceLocation": "westus",
"resourceGroup": "myrg1",
"resourceTags": "tbd",
"policyAssignmentName": "1ef5d536aec743a0aa801c1a",
"policyAssignmentOwner": "tbd",
"policyAssignmentParameters": "{}",
"policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
"policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
"policyDefinitionAction": "audit",
"policyDefinitionCategory": "tbd",
"policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/335cefd2-ab16-430f-b364-974a170eb1d5",
"policySetDefinitionName": "335cefd2-ab16-430f-b364-974a170eb1d5",
"policySetDefinitionOwner": null,
"policySetDefinitionCategory": null,
"policySetDefinitionParameters": null,
"managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
"policyDefinitionReferenceId": "15521232277412542086",
"complianceState": "NonCompliant",
"policyDefinitionGroupNames": [
"myGroup"
]
},
{
"@odata.id": null,
"@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
"timestamp": "2019-10-09T17:41:47Z",
"resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/microsoft.insights/autoscalesettings/mytest1",
"policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
"policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
"effectiveParameters": null,
"isCompliant": true,
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
"resourceType": "/microsoft.insights/autoscalesettings",
"resourceLocation": "westus",
"resourceGroup": "myrg1",
"resourceTags": "tbd",
"policyAssignmentName": "186044306c044a1d8c0ff76c",
"policyAssignmentOwner": "tbd",
"policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
"policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
"policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
"policyDefinitionAction": "audit",
"policyDefinitionCategory": "tbd",
"policySetDefinitionId": "",
"policySetDefinitionName": "",
"policySetDefinitionOwner": null,
"policySetDefinitionCategory": null,
"policySetDefinitionParameters": null,
"managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
"policyDefinitionReferenceId": "",
"complianceState": "Compliant",
"policyDefinitionGroupNames": [
"myGroup"
]
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
}
},
"x-ms-pageable": {
"nextLinkName": "@odata.nextLink"
"nextLinkName": "@odata.nextLink",
"operationName": "PolicyEvents_NextLink"
},
"x-ms-examples": {
"Query at management group scope": {
Expand Down Expand Up @@ -153,7 +154,8 @@
}
},
"x-ms-pageable": {
"nextLinkName": "@odata.nextLink"
"nextLinkName": "@odata.nextLink",
"operationName": "PolicyEvents_NextLink"
},
"x-ms-examples": {
"Query at subscription scope": {
Expand Down Expand Up @@ -237,7 +239,8 @@
}
},
"x-ms-pageable": {
"nextLinkName": "@odata.nextLink"
"nextLinkName": "@odata.nextLink",
"operationName": "PolicyEvents_NextLink"
},
"x-ms-examples": {
"Query at resource group scope": {
Expand Down Expand Up @@ -306,7 +309,8 @@
}
},
"x-ms-pageable": {
"nextLinkName": "@odata.nextLink"
"nextLinkName": "@odata.nextLink",
"operationName": "PolicyEvents_NextLink"
},
"x-ms-examples": {
"Query at resource scope": {
Expand Down Expand Up @@ -393,7 +397,8 @@
}
},
"x-ms-pageable": {
"nextLinkName": "@odata.nextLink"
"nextLinkName": "@odata.nextLink",
"operationName": "PolicyEvents_NextLink"
},
"x-ms-examples": {
"Query at subscription level policy set definition scope": {
Expand Down Expand Up @@ -465,7 +470,8 @@
}
},
"x-ms-pageable": {
"nextLinkName": "@odata.nextLink"
"nextLinkName": "@odata.nextLink",
"operationName": "PolicyEvents_NextLink"
},
"x-ms-examples": {
"Query at subscription level policy definition scope": {
Expand Down Expand Up @@ -537,7 +543,8 @@
}
},
"x-ms-pageable": {
"nextLinkName": "@odata.nextLink"
"nextLinkName": "@odata.nextLink",
"operationName": "PolicyEvents_NextLink"
},
"x-ms-examples": {
"Query at subscription level policy assignment scope": {
Expand Down Expand Up @@ -612,7 +619,8 @@
}
},
"x-ms-pageable": {
"nextLinkName": "@odata.nextLink"
"nextLinkName": "@odata.nextLink",
"operationName": "PolicyEvents_NextLink"
},
"x-ms-examples": {
"Query at resource group level policy assignment scope": {
Expand All @@ -625,6 +633,49 @@
}
}
},
"x-ms-paths": {
"/{nextLink}?Next paging op for policy events": {
"post": {
"operationId": "PolicyEvents_NextLink",
"description": "Subsequent post calls to the next link",
"parameters": [
{
"$ref": "#/parameters/apiVersionParameter"
},
{
"$ref": "#/parameters/skipTokenParameter"
},
{
"name": "nextLink",
"in": "path",
"required": true,
"type": "string",
"description": "Next link for list operation.",
"x-ms-skip-url-encoding": true
}
],
"responses": {
"200": {
"description": "Query results.",
"schema": {
"$ref": "#/definitions/PolicyEventsQueryResults"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/QueryFailure"
}
}
},
"x-ms-examples": {
"Query latest at resource group level policy assignment scope with next link": {
"$ref": "./examples/PolicyEvents_QueryManagementGroupScopeNextLinkSkipToken.json"
}
}
}
}
},
"definitions": {
"PolicyEventsQueryResults": {
"description": "Query results.",
Expand Down
Loading