forked from Azure/azure-rest-api-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Policy compliance data enable pagination (Azure#7909)
* initial commit * Events for 2019-09-01 * fix oav errors * Update 2019-10 tag with 2019-10-01-policyevents * add file to input list * add policyevents to 2018-07-01-preview version * fix path in readme * add examples in events, add parameters * specfication files * fix avocado * fix typo * Fix prettier * Update description for apiversion param * fix typo and description * Revert Lint warning * Remove metadata from events and add missing compliancestates in examples * Add the missing x-ms-pageable Co-authored-by: Namrata Jagasia <[email protected]> Co-authored-by: Phoenix He <[email protected]>
- Loading branch information
Showing
94 changed files
with
5,211 additions
and
95 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...licyInsights/preview/2018-07-01-preview/examples/PolicyEvents_FilterAndAggregateOnly.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"parameters": { | ||
"policyEventsResource": "default", | ||
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", | ||
"api-version": "2018-07-01-preview", | ||
"$from": "2018-02-05T18:00:00Z", | ||
"$filter": "PolicyDefinitionAction eq 'deny'", | ||
"$apply": "aggregate($count as NumDenyEvents)" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default", | ||
"@odata.count": 1, | ||
"value": [ | ||
{ | ||
"@odata.id": null, | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity", | ||
"NumDenyEvents": 40 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...ights/preview/2018-07-01-preview/examples/PolicyEvents_FilterAndGroupByWithAggregate.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"parameters": { | ||
"policyEventsResource": "default", | ||
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", | ||
"api-version": "2019-10-0", | ||
"$from": "2018-02-05T18:00:00Z", | ||
"$filter": "PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny'", | ||
"$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumEvents))", | ||
"$top": 2 | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default", | ||
"@odata.count": 2, | ||
"value": [ | ||
{ | ||
"@odata.id": null, | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity", | ||
"policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29", | ||
"policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", | ||
"policyDefinitionAction": "audit", | ||
"resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/resourcescachemonitor/services/myService", | ||
"NumEvents": 1 | ||
}, | ||
{ | ||
"@odata.id": null, | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity", | ||
"policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d6be6bb37e5f4333baa95c2a", | ||
"policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6", | ||
"policyDefinitionAction": "audit", | ||
"resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/resourcescachemonitor/services/myService", | ||
"NumEvents": 1 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...ts/preview/2018-07-01-preview/examples/PolicyEvents_FilterAndGroupByWithoutAggregate.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"parameters": { | ||
"policyEventsResource": "default", | ||
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", | ||
"api-version": "2018-07-01-preview", | ||
"$from": "2018-01-05T18:00:00Z", | ||
"$filter": "PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append'", | ||
"$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))", | ||
"$top": 2 | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default", | ||
"@odata.count": 2, | ||
"value": [ | ||
{ | ||
"@odata.id": null, | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity", | ||
"policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/5bc427ca-0089-4d0d-85bd-e98d1e40b3bf/providers/microsoft.authorization/policyassignments/storageaccountsku", | ||
"policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", | ||
"policyDefinitionAction": "deny", | ||
"resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/5bc427ca-0089-4d0d-85bd-e98d1e40b3bf/providers/microsoft.storage/storageaccounts/7d528d3a" | ||
}, | ||
{ | ||
"@odata.id": null, | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity", | ||
"policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/da43b50031bf4bce84584faa", | ||
"policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62", | ||
"policyDefinitionAction": "deny", | ||
"resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/mysa1" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
...icyInsights/preview/2018-07-01-preview/examples/PolicyEvents_FilterAndMultipleGroups.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"parameters": { | ||
"policyEventsResource": "default", | ||
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", | ||
"api-version": "2018-07-01-preview", | ||
"$from": "2018-01-01T00:00:00Z", | ||
"$filter": "PolicyDefinitionAction eq 'deny'", | ||
"$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, ResourceId))/groupby((PolicyAssignmentId, PolicyDefinitionId), aggregate($count as NumDeniedResources))", | ||
"$orderby": "NumDeniedResources desc", | ||
"$top": 10 | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default", | ||
"@odata.count": 6, | ||
"value": [ | ||
{ | ||
"@odata.id": null, | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity", | ||
"policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/0591f497c35344fcbaf7a393", | ||
"policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c", | ||
"NumDeniedResources": 3 | ||
}, | ||
{ | ||
"@odata.id": null, | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity", | ||
"policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/myassignment1", | ||
"policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mydefinition1", | ||
"NumDeniedResources": 2 | ||
}, | ||
{ | ||
"@odata.id": null, | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity", | ||
"policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/myassignment1", | ||
"policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mydefinition2", | ||
"NumDeniedResources": 2 | ||
}, | ||
{ | ||
"@odata.id": null, | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity", | ||
"policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/5bc427ca-0089-4d0d-85bd-e98d1e40b3bf/providers/microsoft.authorization/policyassignments/storageaccountsku", | ||
"policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1", | ||
"NumDeniedResources": 1 | ||
}, | ||
{ | ||
"@odata.id": null, | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity", | ||
"policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/da43b50031bf4bce84584faa", | ||
"policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62", | ||
"NumDeniedResources": 1 | ||
}, | ||
{ | ||
"@odata.id": null, | ||
"@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyEvents/$metadata#default/$entity", | ||
"policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/myassignment2", | ||
"policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mydefinition3", | ||
"NumDeniedResources": 1 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
...yInsights/preview/2018-07-01-preview/examples/PolicyEvents_QueryManagementGroupScope.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"parameters": { | ||
"policyEventsResource": "default", | ||
"managementGroupsNamespace": "Microsoft.Management", | ||
"managementGroupName": "myManagementGroup", | ||
"api-version": "2018-07-01-preview" | ||
}, | ||
"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" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.