From 84d025e0d6e002acbd3e580c5f6108f18abbc1d9 Mon Sep 17 00:00:00 2001 From: Jin Soon Lim <38507396+j5lim@users.noreply.github.com> Date: Fri, 1 Feb 2019 10:43:57 -0800 Subject: [PATCH] Add a spec for policyStates API version 2018-07-01-preview (#5134) --- .../PolicyStates_FilterAndAggregateOnly.json | 25 + ...yStates_FilterAndGroupByWithAggregate.json | 40 + ...ates_FilterAndGroupByWithoutAggregate.json | 37 + .../PolicyStates_FilterAndMultipleGroups.json | 111 ++ .../examples/PolicyStates_GetMetadata.json | 14 + .../examples/PolicyStates_ListOperations.json | 41 + ...olicyStates_QueryManagementGroupScope.json | 76 + ...PolicyStates_QueryNestedResourceScope.json | 75 + ...sourceGroupLevelPolicyAssignmentScope.json | 78 + .../PolicyStates_QueryResourceGroupScope.json | 76 + .../PolicyStates_QueryResourceScope.json | 75 + ...rceScopeExpandPolicyEvaluationDetails.json | 114 ++ ...ySubscriptionLevelNestedResourceScope.json | 75 + ...ubscriptionLevelPolicyAssignmentScope.json | 77 + ...ubscriptionLevelPolicyDefinitionScope.json | 77 + ...criptionLevelPolicySetDefinitionScope.json | 77 + ...s_QuerySubscriptionLevelResourceScope.json | 75 + .../PolicyStates_QuerySubscriptionScope.json | 75 + ...yStates_SummarizeManagementGroupScope.json | 32 + ...sourceGroupLevelPolicyAssignmentScope.json | 50 + ...icyStates_SummarizeResourceGroupScope.json | 69 + .../PolicyStates_SummarizeResourceScope.json | 353 ++++ ...ubscriptionLevelPolicyAssignmentScope.json | 77 + ...ubscriptionLevelPolicyDefinitionScope.json | 110 ++ ...criptionLevelPolicySetDefinitionScope.json | 33 + ...licyStates_SummarizeSubscriptionScope.json | 147 ++ .../PolicyStates_TimeRangeSortSelectTop.json | 42 + .../2018-07-01-preview/policyStates.json | 1605 +++++++++++++++++ .../policyinsights/resource-manager/readme.md | 2 +- 29 files changed, 3737 insertions(+), 1 deletion(-) create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndAggregateOnly.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndGroupByWithAggregate.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndGroupByWithoutAggregate.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndMultipleGroups.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_GetMetadata.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_ListOperations.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryManagementGroupScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryNestedResourceScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceGroupScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelNestedResourceScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelResourceScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeManagementGroupScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceGroupScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicyAssignmentScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionScope.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_TimeRangeSortSelectTop.json create mode 100644 specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndAggregateOnly.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndAggregateOnly.json new file mode 100644 index 000000000000..4fcc6ac51319 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndAggregateOnly.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "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 NumDenyStates)" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest", + "@odata.count": 1, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "NumDenyStates": 6 + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndGroupByWithAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndGroupByWithAggregate.json new file mode 100644 index 000000000000..11574b7afa35 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndGroupByWithAggregate.json @@ -0,0 +1,40 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "api-version": "2018-07-01-preview", + "$from": "2018-02-05T18:00:00Z", + "$filter": "IsCompliant eq false and (PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny')", + "$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumAuditDenyNonComplianceRecords))", + "$orderby": "NumAuditDenyNonComplianceRecords desc", + "$top": 2 + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionAction": "audit", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myrg/providers/microsoft.classiccompute/domainnames/myDomainName", + "NumAuditDenyNonComplianceRecords": 10 + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1", + "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/myrg/providers/microsoft.classiccompute/domainnames/myDomainName", + "NumAuditDenyNonComplianceRecords": 10 + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndGroupByWithoutAggregate.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndGroupByWithoutAggregate.json new file mode 100644 index 000000000000..57ab2cf53a13 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndGroupByWithoutAggregate.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "api-version": "2018-07-01-preview", + "$from": "2018-01-05T18:00:00Z", + "$filter": "IsCompliant eq false and (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/policyStates/$metadata#latest", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/enable monitoring in azure security center", + "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionAction": "auditifnotexists", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myrg/providers/microsoft.network/virtualnetworks/vnet" + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/89b27f38-e9e4-4468-ab81-801c84b8c017", + "policyDefinitionId": "/providers/microsoft.authorization/policydefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed", + "policyDefinitionAction": "auditifnotexists", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myrg/providers/microsoft.network/virtualnetworks/vnet" + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndMultipleGroups.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndMultipleGroups.json new file mode 100644 index 000000000000..72b7f24e1c09 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_FilterAndMultipleGroups.json @@ -0,0 +1,111 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "api-version": "2018-07-01-preview", + "$filter": "IsCompliant eq false", + "$apply": "groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId, ResourceId))/groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId), aggregate($count as NumNonCompliantResources))", + "$orderby": "NumNonCompliantResources desc", + "$top": 10 + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest", + "@odata.count": 10, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "14799174781370023846", + "NumNonCompliantResources": 557 + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "1679708035638239273", + "NumNonCompliantResources": 557 + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "14799174781370023846", + "NumNonCompliantResources": 557 + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "1679708035638239273", + "NumNonCompliantResources": 557 + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7", + "policySetDefinitionId": "", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "NumNonCompliantResources": 557 + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49", + "policySetDefinitionId": "", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionReferenceId": "", + "NumNonCompliantResources": 557 + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "NumNonCompliantResources": 552 + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/a03db67e-a286-43c3-9098-b2da83d361ad", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionReferenceId": "8935913113203900114", + "NumNonCompliantResources": 544 + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/8174043a1e2849179635b874", + "policySetDefinitionId": "", + "policyDefinitionId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066", + "policyDefinitionReferenceId": "", + "NumNonCompliantResources": 526 + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionReferenceId": "2124621540977569058", + "NumNonCompliantResources": 509 + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_GetMetadata.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_GetMetadata.json new file mode 100644 index 000000000000..243f3ef67de0 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_GetMetadata.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "scope": "subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "headers": { + "content-type": "application/xml" + }, + "body": " Org.OData.Capabilities.V1.ConformanceLevelType/Minimal application/json;odata.metadata=minimal;IEEE754Compatible=false;odata.streaming=true application/json;odata.metadata=none;IEEE754Compatible=false;odata.streaming=true " + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_ListOperations.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_ListOperations.json new file mode 100644 index 000000000000..fde95b67be92 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_ListOperations.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.count": 3, + "value": [ + { + "name": "Microsoft.PolicyInsights/policyEvents/queryResults/action", + "display": { + "provider": "Microsoft Policy Insights", + "resource": "Policy Events", + "operation": "Query Policy Events", + "description": "Query information about policy events." + } + }, + { + "name": "Microsoft.PolicyInsights/policyStates/queryResults/action", + "display": { + "provider": "Microsoft Policy Insights", + "resource": "Policy States", + "operation": "Query Policy States", + "description": "Query information about policy states." + } + }, + { + "name": "Microsoft.PolicyInsights/policyStates/summarize/action", + "display": { + "provider": "Microsoft Policy Insights", + "resource": "Policy States", + "operation": "Query Policy Latest States Summary", + "description": "Query summary information about policy latest states." + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryManagementGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryManagementGroupScope.json new file mode 100644 index 000000000000..f42b7d750123 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryManagementGroupScope.json @@ -0,0 +1,76 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "managementGroupsNamespace": "Microsoft.Management", + "managementGroupName": "myManagementGroup", + "api-version": "2018-07-01-preview" + }, + "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": "2018-02-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" + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-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": false, + "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": "" + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryNestedResourceScope.json new file mode 100644 index 000000000000..7c41461ed920 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryNestedResourceScope.json @@ -0,0 +1,75 @@ +{ + "parameters": { + "policyStatesResource": "default", + "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyStates/$metadata#default", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity", + "timestamp": "2018-02-09T16:04:31Z", + "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication", + "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c", + "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "resourceType": "/Microsoft.ServiceFabric/clusters/applications", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "186044306c044a1d8c0ff76c", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}", + "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg", + "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity", + "timestamp": "2018-02-09T16:04:31Z", + "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication", + "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c", + "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "resourceType": "/Microsoft.ServiceFabric/clusters/applications", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "186044306c044a1d8c0ff76c", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}", + "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg", + "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json new file mode 100644 index 000000000000..64dd190c3361 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json @@ -0,0 +1,78 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceGroupName": "myResourceGroup", + "authorizationNamespace": "Microsoft.Authorization", + "policyAssignmentName": "myPolicyAssignment", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-13T00:38:50Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Security/policies/mySecurityPolicy", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/4a0425e4-97bf-4ad0-ab36-145b94083c60", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.Security/policies", + "resourceLocation": null, + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "myPolicyAssignment", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"EUS, WEU\"]}}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup", + "policyDefinitionName": "4a0425e4-97bf-4ad0-ab36-145b94083c60", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-13T00:38:50Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/test", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/4a0425e4-97bf-4ad0-ab36-145b94083c60", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.Authorization/policyAssignments", + "resourceLocation": null, + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "myPolicyAssignment", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"EUS, WEU\"]}}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup", + "policyDefinitionName": "4a0425e4-97bf-4ad0-ab36-145b94083c60", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceGroupScope.json new file mode 100644 index 000000000000..ce9eb2692a22 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceGroupScope.json @@ -0,0 +1,76 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceGroupName": "myResourceGroup", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-09T18:42:42Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mysa1", + "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", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.Storage/storageAccounts", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "3f3c4330183b4e218fe6fd29", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852", + "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-09T18:42:42Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mysa1", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.Storage/storageAccounts", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "3f3c4330183b4e218fe6fd29", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852", + "policyDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e3682", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScope.json new file mode 100644 index 000000000000..f70fdf4a8563 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScope.json @@ -0,0 +1,75 @@ +{ + "parameters": { + "policyStatesResource": "default", + "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity", + "timestamp": "2018-02-09T16:04:31Z", + "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test", + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "resourceType": "/Microsoft.ClassicCompute/domainNames", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "test", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}", + "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "policyDefinitionName": "Audit a tag and it's value", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity", + "timestamp": "2018-02-09T16:04:31Z", + "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test", + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "resourceType": "/Microsoft.ClassicCompute/domainNames", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "test", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}", + "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "policyDefinitionName": "Audit a tag and it's value", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json new file mode 100644 index 000000000000..b7e3ea191a3c --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json @@ -0,0 +1,114 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", + "api-version": "2018-07-01-preview", + "$expand": "policyEvaluationDetails" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity", + "timestamp": "2018-02-09T16:04:31Z", + "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test", + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "resourceType": "/Microsoft.ClassicCompute/domainNames", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "test", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}", + "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "policyDefinitionName": "Audit a tag and it's value", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null, + "complianceState": "NonCompliant", + "policyEvaluationDetails": { + "evaluatedExpressions": [ + { + "result": "True", + "expression": "type", + "path": "type", + "expressionValue": "Microsoft.ClassicCompute/domainNames", + "targetValue": "Microsoft.ClassicCompute/domainNames", + "operator": "Equals" + }, + { + "result": "False", + "expression": "name", + "path": "name", + "expressionValue": "myDomainName", + "targetValue": "someName", + "operator": "Equals" + } + ] + } + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity", + "timestamp": "2018-02-09T16:04:31Z", + "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test2", + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/AuditIfNotExistsTest", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "resourceType": "/Microsoft.ClassicCompute/domainNames", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "test", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{}", + "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "policyDefinitionName": "AuditIfNotExists test", + "policyDefinitionAction": "auditifnotexists", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null, + "complianceState": "NonCompliant", + "policyEvaluationDetails": { + "evaluatedExpressions": [ + { + "result": "False", + "expression": "name", + "path": "name", + "expressionValue": "myDomainName", + "targetValue": "someName", + "operator": "Equals" + } + ], + "ifNotExistsDetails": { + "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", + "totalResources": 1 + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelNestedResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelNestedResourceScope.json new file mode 100644 index 000000000000..637963528da3 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelNestedResourceScope.json @@ -0,0 +1,75 @@ +{ + "parameters": { + "policyStatesResource": "default", + "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyStates/$metadata#default", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity", + "timestamp": "2018-02-09T16:04:31Z", + "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource", + "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c", + "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "resourceType": "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType", + "resourceLocation": "eastus", + "resourceGroup": "", + "resourceTags": "tbd", + "policyAssignmentName": "186044306c044a1d8c0ff76c", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}", + "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg", + "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity", + "timestamp": "2018-02-09T16:04:31Z", + "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource", + "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c", + "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "resourceType": "/Microsoft.SomeNamespace/someResourceType/someNestedResourceType", + "resourceLocation": "eastus", + "resourceGroup": "", + "resourceTags": "tbd", + "policyAssignmentName": "186044306c044a1d8c0ff76c", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}", + "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/mymg", + "policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json new file mode 100644 index 000000000000..c8f4789aa3b1 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json @@ -0,0 +1,77 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "authorizationNamespace": "Microsoft.Authorization", + "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-13T00:45:19Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/my-ip-1", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.Network/publicIPAddresses", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"TAGNAME_1\":{\"value\":\"test\"}}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852", + "policyDefinitionName": "c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "policySetDefinitionName": "12b58873-e0f8-4b95-936c-86cbe7c9d697", + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": "2124621540977569058" + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-13T00:45:19Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/my-ip-1", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.Network/publicIPAddresses", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"TAGNAME_1\":{\"value\":\"test\"}}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852", + "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "policySetDefinitionName": "12b58873-e0f8-4b95-936c-86cbe7c9d697", + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": "14799174781370023846" + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json new file mode 100644 index 000000000000..f64b514f299e --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json @@ -0,0 +1,77 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "authorizationNamespace": "Microsoft.Authorization", + "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-13T00:50:27Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/services/myService", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/d9da7e80af6344ab9d342aa7", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.ServiceFabric/clusters/applications/services", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "d9da7e80af6344ab9d342aa7", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"tagName\":{\"value\":\"MyTag\"}}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852", + "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-13T00:50:27Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/services/myService", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/d9da7e80af6344ab9d342aa7", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.ServiceFabric/clusters/applications/services", + "resourceLocation": "eastus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "d9da7e80af6344ab9d342aa7", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"tagName\":{\"value\":\"MyTag\"}}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852", + "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json new file mode 100644 index 000000000000..5b2734f5ca0e --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json @@ -0,0 +1,77 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "authorizationNamespace": "Microsoft.Authorization", + "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-13T00:54:58Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/mySite", + "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", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.Web/sites", + "resourceLocation": "centralus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "3f3c4330183b4e218fe6fd29", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852", + "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-13T00:54:58Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/mySite", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29", + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/LocationAuditDefinition", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.Web/sites", + "resourceLocation": "centralus", + "resourceGroup": "myResourceGroup", + "resourceTags": "tbd", + "policyAssignmentName": "3f3c4330183b4e218fe6fd29", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852", + "policyDefinitionName": "LocationAuditDefinition", + "policyDefinitionAction": "Audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelResourceScope.json new file mode 100644 index 000000000000..fc4d370ddf7d --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionLevelResourceScope.json @@ -0,0 +1,75 @@ +{ + "parameters": { + "policyStatesResource": "default", + "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity", + "timestamp": "2018-02-09T16:04:31Z", + "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName", + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test", + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "resourceType": "/Microsoft.SomeNamespace/someResourceType", + "resourceLocation": "eastus", + "resourceGroup": "", + "resourceTags": "tbd", + "policyAssignmentName": "test", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}", + "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "policyDefinitionName": "Audit a tag and it's value", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName/providers/Microsoft.PolicyInsights/policyStates/$metadata#default/$entity", + "timestamp": "2018-02-09T16:04:31Z", + "resourceId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName", + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test", + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "resourceType": "/Microsoft.SomeNamespace/someResourceType", + "resourceLocation": "eastus", + "resourceGroup": "", + "resourceTags": "tbd", + "policyAssignmentName": "test", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{\"tagName\":{\"value\":\"no\"},\"tagValue\":{\"value\":\"no\"}}", + "policyAssignmentScope": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5", + "policyDefinitionName": "Audit a tag and it's value", + "policyDefinitionAction": "audit", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": null, + "policySetDefinitionName": null, + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionScope.json new file mode 100644 index 000000000000..44c5cce101bc --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QuerySubscriptionScope.json @@ -0,0 +1,75 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-09T17:48:05Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/Microsoft.Network/publicIPAddresses/mypubip1", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/Enable Monitoring in Azure Security Center", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9daedab3-fb2d-461e-b861-71790eead4f6", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.Network/publicIPAddresses", + "resourceLocation": "eastus", + "resourceGroup": "myrg1", + "resourceTags": "tbd", + "policyAssignmentName": "Enable Monitoring in Azure Security Center", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852", + "policyDefinitionName": "9daedab3-fb2d-461e-b861-71790eead4f6", + "policyDefinitionAction": "AuditIfNotExists", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-09T17:48:05Z", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/Microsoft.Network/publicIPAddresses/mypubip1", + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyAssignments/9ac09b0657d942e5ad4041a6", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9daedab3-fb2d-461e-b861-71790eead4f6", + "effectiveParameters": null, + "isCompliant": false, + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceType": "/Microsoft.Network/publicIPAddresses", + "resourceLocation": "eastus", + "resourceGroup": "myrg1", + "resourceTags": "tbd", + "policyAssignmentName": "9ac09b0657d942e5ad4041a6", + "policyAssignmentOwner": "tbd", + "policyAssignmentParameters": "{}", + "policyAssignmentScope": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852", + "policyDefinitionName": "9daedab3-fb2d-461e-b861-71790eead4f6", + "policyDefinitionAction": "AuditIfNotExists", + "policyDefinitionCategory": "tbd", + "policySetDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "policySetDefinitionName": "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + "policySetDefinitionOwner": null, + "policySetDefinitionCategory": null, + "policySetDefinitionParameters": null, + "managementGroupIds": "mymg,fff988bf-fff1-ffff-fffb-fffcd011db47", + "policyDefinitionReferenceId": null + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeManagementGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeManagementGroupScope.json new file mode 100644 index 000000000000..1af9f1f5d331 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeManagementGroupScope.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "policyStatesSummaryResource": "latest", + "managementGroupsNamespace": "Microsoft.Management", + "managementGroupName": "myManagementGroup", + "api-version": "2018-07-01-preview", + "$from": "2018-02-05T18:00:00Z", + "$to": "2018-02-06T18:00:00Z", + "$filter": "PolicyDefinitionAction eq 'deny' or PolicyDefinitionAction eq 'audit'", + "$top": 0 + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary", + "@odata.count": 1, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity", + "results": { + "queryResultsUri": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-05 18:00:00Z&$to=2018-02-06 18:00:00Z&$filter=(PolicyDefinitionAction eq 'deny' or PolicyDefinitionAction eq 'audit') and IsCompliant eq false", + "nonCompliantResources": 15410, + "nonCompliantPolicies": 68 + }, + "policyAssignments": [] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json new file mode 100644 index 000000000000..6de6b2c7ba44 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "policyStatesSummaryResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceGroupName": "myResourceGroup", + "authorizationNamespace": "Microsoft.Authorization", + "policyAssignmentName": "b7a1ca2596524e3ab19597f2", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/b7a1ca2596524e3ab19597f2/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary", + "@odata.count": 1, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/b7a1ca2596524e3ab19597f2/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/b7a1ca2596524e3ab19597f2/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-22 23:54:22Z&$to=2018-02-23 23:54:22Z&$filter=IsCompliant eq false", + "nonCompliantResources": 7, + "nonCompliantPolicies": 1 + }, + "policyAssignments": [ + { + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b7a1ca2596524e3ab19597f2", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/b7a1ca2596524e3ab19597f2/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-22 23:54:22Z&$to=2018-02-23 23:54:22Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b7a1ca2596524e3ab19597f2'", + "nonCompliantResources": 7, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/4a0425e4-97bf-4ad0-ab36-145b94083c60", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/b7a1ca2596524e3ab19597f2/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-22 23:54:22Z&$to=2018-02-23 23:54:22Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b7a1ca2596524e3ab19597f2' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/4a0425e4-97bf-4ad0-ab36-145b94083c60'", + "nonCompliantResources": 7 + } + } + ] + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceGroupScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceGroupScope.json new file mode 100644 index 000000000000..40e5acdb8cd8 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceGroupScope.json @@ -0,0 +1,69 @@ +{ + "parameters": { + "policyStatesSummaryResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceGroupName": "myResourceGroup", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary", + "@odata.count": 1, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:55:09Z&$to=2018-02-13 19:55:09Z&$filter=IsCompliant eq false", + "nonCompliantResources": 55, + "nonCompliantPolicies": 20 + }, + "policyAssignments": [ + { + "policyAssignmentId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c", + "policySetDefinitionId": "", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:55:09Z&$to=2018-02-13 19:55:09Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c'", + "nonCompliantResources": 55, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:55:09Z&$to=2018-02-13 19:55:09Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d'", + "nonCompliantResources": 55 + } + } + ] + }, + { + "policyAssignmentId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a", + "policySetDefinitionId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policysetdefinitions/335cefd2-ab16-430f-b364-974a170eb1d5", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:55:09Z&$to=2018-02-13 19:55:09Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a'", + "nonCompliantResources": 55, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:55:09Z&$to=2018-02-13 19:55:09Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d'", + "nonCompliantResources": 55 + } + } + ] + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceScope.json new file mode 100644 index 000000000000..4dd9b0ebc4bb --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeResourceScope.json @@ -0,0 +1,353 @@ +{ + "parameters": { + "policyStatesSummaryResource": "latest", + "resourceId": "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary", + "@odata.count": 1, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false", + "nonCompliantResources": 1, + "nonCompliantPolicies": 14 + }, + "policyAssignments": [ + { + "policyAssignmentId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/8174043a1e2849179635b874", + "policySetDefinitionId": "", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/8174043a1e2849179635b874'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/8174043a1e2849179635b874' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a", + "policySetDefinitionId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policysetdefinitions/335cefd2-ab16-430f-b364-974a170eb1d5", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c", + "policySetDefinitionId": "", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policyassignments/186044306c044a1d8c0ff76c' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/mymg/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/fed0d6ef-c76c-4a3d-a4ec-de07b1e7900b", + "policySetDefinitionId": "", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/fed0d6ef-c76c-4a3d-a4ec-de07b1e7900b'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/fed0d6ef-c76c-4a3d-a4ec-de07b1e7900b' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f5f5249bd6124d0692c2af52", + "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/bafcd34b-58c6-47b4-bc8b-f35198d6a025", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f5f5249bd6124d0692c2af52'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/test", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f5f5249bd6124d0692c2af52' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/testtest'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e4a08f18-4e3e-47af-a2eb-cc96d8c9a030", + "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/e4a08f18-4e3e-47af-a2eb-cc96d8c9a01f", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e4a08f18-4e3e-47af-a2eb-cc96d8c9a030'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 2 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and its value", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e4a08f18-4e3e-47af-a2eb-cc96d8c9a030' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and its value'", + "nonCompliantResources": 1 + } + }, + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e4a08f18-4e3e-47af-a2eb-cc96d8c9a030' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01", + "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/a03db67e-a286-43c3-9098-b2da83d361ad", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49", + "policySetDefinitionId": "", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dc7c38a6-42a9-4261-b54e-92549cd6e010", + "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/deny a resource based on owner tag", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dc7c38a6-42a9-4261-b54e-92549cd6e010'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/dc7c38a6-42a9-4261-b54e-92549cd6e010' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/audit a tag and it's value'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7", + "policySetDefinitionId": "", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d6be6bb37e5f4333baa95c2a", + "policySetDefinitionId": "", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d6be6bb37e5f4333baa95c2a'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/d6be6bb37e5f4333baa95c2a' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29", + "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531", + "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 3 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/locationauditdefinition", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/locationauditdefinition'", + "nonCompliantResources": 1 + } + }, + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'", + "nonCompliantResources": 1 + } + }, + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'", + "nonCompliantResources": 1 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1", + "policySetDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1'", + "nonCompliantResources": 1, + "nonCompliantPolicies": 3 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/locationauditdefinition", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/locationauditdefinition'", + "nonCompliantResources": 1 + } + }, + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'", + "nonCompliantResources": 1 + } + }, + { + "policyDefinitionId": "/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:59:17Z&$to=2018-02-13 19:59:17Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1' and PolicyDefinitionId eq '/subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'", + "nonCompliantResources": 1 + } + } + ] + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicyAssignmentScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicyAssignmentScope.json new file mode 100644 index 000000000000..ceb06b37a1c0 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicyAssignmentScope.json @@ -0,0 +1,77 @@ +{ + "parameters": { + "policyStatesSummaryResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "authorizationNamespace": "Microsoft.Authorization", + "policyAssignmentName": "ec8f9645-8ecb-4abb-9c0b-5292f19d4003", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary", + "@odata.count": 1, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false", + "nonCompliantResources": 531, + "nonCompliantPolicies": 1 + }, + "policyAssignments": [ + { + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531'", + "nonCompliantResources": 531, + "nonCompliantPolicies": 4 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'", + "nonCompliantResources": 531 + } + }, + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'", + "nonCompliantResources": 531 + } + }, + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/locationauditdefinition", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/locationauditdefinition'", + "nonCompliantResources": 220 + } + }, + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:09:24Z&$to=2018-02-13 20:09:24Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682'", + "nonCompliantResources": 54 + } + } + ] + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json new file mode 100644 index 000000000000..adf0fff51c2a --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json @@ -0,0 +1,110 @@ +{ + "parameters": { + "policyStatesSummaryResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "authorizationNamespace": "Microsoft.Authorization", + "policyDefinitionName": "24813039-7534-408a-9842-eb99f45721b1", + "api-version": "2018-07-01-preview" + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary", + "@odata.count": 1, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false", + "nonCompliantResources": 561, + "nonCompliantPolicies": 4 + }, + "policyAssignments": [ + { + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7", + "policySetDefinitionId": "", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7'", + "nonCompliantResources": 558, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'", + "nonCompliantResources": 558 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29'", + "nonCompliantResources": 553, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'", + "nonCompliantResources": 553 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1'", + "nonCompliantResources": 531, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'", + "nonCompliantResources": 531 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531'", + "nonCompliantResources": 531, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 20:07:10Z&$to=2018-02-13 20:07:10Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'", + "nonCompliantResources": 531 + } + } + ] + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json new file mode 100644 index 000000000000..62de2e9ba540 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "policyStatesSummaryResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "authorizationNamespace": "Microsoft.Authorization", + "policySetDefinitionName": "3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "api-version": "2018-07-01-preview", + "$from": "2018-02-05T18:00:00Z", + "$to": "2018-02-06T18:00:00Z", + "$filter": "PolicyDefinitionAction eq 'deny'", + "$top": 1 + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary", + "@odata.count": 1, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-05 18:00:00Z&$to=2018-02-06 18:00:00Z&$filter=(PolicyDefinitionAction eq 'deny') and IsCompliant eq false", + "nonCompliantResources": 0, + "nonCompliantPolicies": 0 + }, + "policyAssignments": [] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionScope.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionScope.json new file mode 100644 index 000000000000..df8b17e9016e --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_SummarizeSubscriptionScope.json @@ -0,0 +1,147 @@ +{ + "parameters": { + "policyStatesSummaryResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "api-version": "2018-07-01-preview", + "$top": 5 + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary", + "@odata.count": 1, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#summary/$entity", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false", + "nonCompliantResources": 619, + "nonCompliantPolicies": 40 + }, + "policyAssignments": [ + { + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/a03db67e-a286-43c3-9098-b2da83d361ad", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01'", + "nonCompliantResources": 557, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'", + "nonCompliantResources": 557 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7", + "policySetDefinitionId": "", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7'", + "nonCompliantResources": 557, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'", + "nonCompliantResources": 557 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49", + "policySetDefinitionId": "", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49'", + "nonCompliantResources": 557, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474'", + "nonCompliantResources": 557 + } + } + ] + }, + { + "policyAssignmentId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a", + "policySetDefinitionId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policysetdefinitions/335cefd2-ab16-430f-b364-974a170eb1d5", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a'", + "nonCompliantResources": 557, + "nonCompliantPolicies": 1 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policyassignments/1ef5d536aec743a0aa801c1a' and PolicyDefinitionId eq '/providers/microsoft.management/managementgroups/myManagementGroup/providers/microsoft.authorization/policydefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d'", + "nonCompliantResources": 557 + } + } + ] + }, + { + "policyAssignmentId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29", + "policySetDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29'", + "nonCompliantResources": 552, + "nonCompliantPolicies": 3 + }, + "policyDefinitions": [ + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1'", + "nonCompliantResources": 552 + } + }, + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/locationauditdefinition", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/locationauditdefinition'", + "nonCompliantResources": 29 + } + }, + { + "policyDefinitionId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682", + "policyDefinitionReferenceId": "", + "effect": "audit", + "results": { + "queryResultsUri": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-07-01-preview&$from=2018-02-12 19:48:53Z&$to=2018-02-13 19:48:53Z&$filter=IsCompliant eq false and PolicyAssignmentId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29' and PolicyDefinitionId eq '/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e3682'", + "nonCompliantResources": 2 + } + } + ] + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_TimeRangeSortSelectTop.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_TimeRangeSortSelectTop.json new file mode 100644 index 000000000000..67daad9e9a5d --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_TimeRangeSortSelectTop.json @@ -0,0 +1,42 @@ +{ + "parameters": { + "policyStatesResource": "latest", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "api-version": "2018-07-01-preview", + "$from": "2018-02-05T18:00:00Z", + "$to": "2018-02-06T18:00:00Z", + "$orderby": "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId", + "$select": "Timestamp, PolicyAssignmentId, PolicyDefinitionId, SubscriptionId, ResourceGroup, ResourceId", + "$top": 2 + }, + "responses": { + "200": { + "body": { + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest", + "@odata.count": 2, + "value": [ + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-06T17:58:00Z", + "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/8cb1e007-947f-423a-ad0c-7ab7dc7d0255/providers/Microsoft.Authorization/policyAssignments/1654a0254ab34920a60f94eb", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceGroup": "myrg1", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/Microsoft.Storage/storageAccounts/mysa1" + }, + { + "@odata.id": null, + "@odata.context": "https://management.azure.com/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity", + "timestamp": "2018-02-06T17:58:00Z", + "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/8cb1e007-947f-423a-ad0c-7ab7dc7d0255/providers/Microsoft.Authorization/policyAssignments/1654a0254ab34920a60f94eb", + "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759", + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceGroup": "myrg2", + "resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg2/providers/Microsoft.Storage/storageAccounts/mysa2" + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json new file mode 100644 index 000000000000..1ee969ee0bef --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json @@ -0,0 +1,1605 @@ +{ + "swagger": "2.0", + "info": { + "title": "PolicyStatesClient", + "version": "2018-07-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": { + "post": { + "operationId": "PolicyStates_ListQueryResultsForManagementGroup", + "description": "Queries policy states for the resources under the management group.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesResourceParameter" + }, + { + "$ref": "#/parameters/managementGroupsNamespaceParameter" + }, + { + "$ref": "#/parameters/managementGroupNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/orderByParameter" + }, + { + "$ref": "#/parameters/selectParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + }, + { + "$ref": "#/parameters/applyParameter" + } + ], + "responses": { + "200": { + "description": "Query results.", + "schema": { + "$ref": "#/definitions/PolicyStatesQueryResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Query latest at management group scope": { "$ref": "./examples/PolicyStates_QueryManagementGroupScope.json" } + } + } + }, + "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": { + "post": { + "operationId": "PolicyStates_SummarizeForManagementGroup", + "description": "Summarizes policy states for the resources under the management group.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesSummaryResourceParameter" + }, + { + "$ref": "#/parameters/managementGroupsNamespaceParameter" + }, + { + "$ref": "#/parameters/managementGroupNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "Summarize results.", + "schema": { + "$ref": "#/definitions/SummarizeResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Summarize at management group scope": { "$ref": "./examples/PolicyStates_SummarizeManagementGroupScope.json" } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": { + "post": { + "operationId": "PolicyStates_ListQueryResultsForSubscription", + "description": "Queries policy states for the resources under the subscription.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/orderByParameter" + }, + { + "$ref": "#/parameters/selectParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + }, + { + "$ref": "#/parameters/applyParameter" + } + ], + "responses": { + "200": { + "description": "Query results.", + "schema": { + "$ref": "#/definitions/PolicyStatesQueryResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Query latest at subscription scope": { "$ref": "./examples/PolicyStates_QuerySubscriptionScope.json" }, + "Time range; sort, select and limit": { "$ref": "./examples/PolicyStates_TimeRangeSortSelectTop.json" }, + "Filter and group with aggregate": { "$ref": "./examples/PolicyStates_FilterAndGroupByWithAggregate.json" }, + "Filter and group without aggregate": { "$ref": "./examples/PolicyStates_FilterAndGroupByWithoutAggregate.json" }, + "Filter and aggregate only": { "$ref": "./examples/PolicyStates_FilterAndAggregateOnly.json" }, + "Filter and multiple groups": { "$ref": "./examples/PolicyStates_FilterAndMultipleGroups.json" } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": { + "post": { + "operationId": "PolicyStates_SummarizeForSubscription", + "description": "Summarizes policy states for the resources under the subscription.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesSummaryResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "Summarize results.", + "schema": { + "$ref": "#/definitions/SummarizeResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Summarize at subscription scope": { "$ref": "./examples/PolicyStates_SummarizeSubscriptionScope.json" } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": { + "post": { + "operationId": "PolicyStates_ListQueryResultsForResourceGroup", + "description": "Queries policy states for the resources under the resource group.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/orderByParameter" + }, + { + "$ref": "#/parameters/selectParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + }, + { + "$ref": "#/parameters/applyParameter" + } + ], + "responses": { + "200": { + "description": "Query results.", + "schema": { + "$ref": "#/definitions/PolicyStatesQueryResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Query latest at resource group scope": { "$ref": "./examples/PolicyStates_QueryResourceGroupScope.json" } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": { + "post": { + "operationId": "PolicyStates_SummarizeForResourceGroup", + "description": "Summarizes policy states for the resources under the resource group.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesSummaryResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "Summarize results.", + "schema": { + "$ref": "#/definitions/SummarizeResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Summarize at resource group scope": { "$ref": "./examples/PolicyStates_SummarizeResourceGroupScope.json" } + } + } + }, + "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": { + "post": { + "operationId": "PolicyStates_ListQueryResultsForResource", + "description": "Queries policy states for the resource.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesResourceParameter" + }, + { + "$ref": "#/parameters/resourceIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/orderByParameter" + }, + { + "$ref": "#/parameters/selectParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + }, + { + "$ref": "#/parameters/applyParameter" + }, + { + "$ref": "#/parameters/expandParameter" + } + ], + "responses": { + "200": { + "description": "Query results.", + "schema": { + "$ref": "#/definitions/PolicyStatesQueryResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Query all policy states at resource scope": { "$ref": "./examples/PolicyStates_QueryResourceScope.json" }, + "Query all policy states at subscription level resource scope": { "$ref": "./examples/PolicyStates_QuerySubscriptionLevelResourceScope.json" }, + "Query all policy states at nested resource scope": { "$ref": "./examples/PolicyStates_QueryNestedResourceScope.json" }, + "Query all policy states at subscription level nested resource scope": { "$ref": "./examples/PolicyStates_QuerySubscriptionLevelNestedResourceScope.json" }, + "Query all policy states at resource scope and expand policyEvaluationDetails": { "$ref": "./examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json" } + } + } + }, + "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": { + "post": { + "operationId": "PolicyStates_SummarizeForResource", + "description": "Summarizes policy states for the resource.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesSummaryResourceParameter" + }, + { + "$ref": "#/parameters/resourceIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "Summarize results.", + "schema": { + "$ref": "#/definitions/SummarizeResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Summarize at resource scope": { "$ref": "./examples/PolicyStates_SummarizeResourceScope.json" } + } + } + }, + "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": { + "post": { + "operationId": "PolicyStates_ListQueryResultsForPolicySetDefinition", + "description": "Queries policy states for the subscription level policy set definition.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/authorizationNamespaceParameter" + }, + { + "$ref": "#/parameters/policySetDefinitionNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/orderByParameter" + }, + { + "$ref": "#/parameters/selectParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + }, + { + "$ref": "#/parameters/applyParameter" + } + ], + "responses": { + "200": { + "description": "Query results.", + "schema": { + "$ref": "#/definitions/PolicyStatesQueryResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Query latest at subscription level policy set definition scope": { "$ref": "./examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json" } + } + } + }, + "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": { + "post": { + "operationId": "PolicyStates_SummarizeForPolicySetDefinition", + "description": "Summarizes policy states for the subscription level policy set definition.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesSummaryResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/authorizationNamespaceParameter" + }, + { + "$ref": "#/parameters/policySetDefinitionNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "Summarize results.", + "schema": { + "$ref": "#/definitions/SummarizeResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Summarize at policy set definition scope": { "$ref": "./examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json" } + } + } + }, + "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": { + "post": { + "operationId": "PolicyStates_ListQueryResultsForPolicyDefinition", + "description": "Queries policy states for the subscription level policy definition.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/authorizationNamespaceParameter" + }, + { + "$ref": "#/parameters/policyDefinitionNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/orderByParameter" + }, + { + "$ref": "#/parameters/selectParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + }, + { + "$ref": "#/parameters/applyParameter" + } + ], + "responses": { + "200": { + "description": "Query results.", + "schema": { + "$ref": "#/definitions/PolicyStatesQueryResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Query latest at subscription level policy definition scope": { "$ref": "./examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json" } + } + } + }, + "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": { + "post": { + "operationId": "PolicyStates_SummarizeForPolicyDefinition", + "description": "Summarizes policy states for the subscription level policy definition.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesSummaryResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/authorizationNamespaceParameter" + }, + { + "$ref": "#/parameters/policyDefinitionNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "Summarize results.", + "schema": { + "$ref": "#/definitions/SummarizeResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Summarize at policy definition scope": { "$ref": "./examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json" } + } + } + }, + "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": { + "post": { + "operationId": "PolicyStates_ListQueryResultsForSubscriptionLevelPolicyAssignment", + "description": "Queries policy states for the subscription level policy assignment.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/authorizationNamespaceParameter" + }, + { + "$ref": "#/parameters/policyAssignmentNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/orderByParameter" + }, + { + "$ref": "#/parameters/selectParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + }, + { + "$ref": "#/parameters/applyParameter" + } + ], + "responses": { + "200": { + "description": "Query results.", + "schema": { + "$ref": "#/definitions/PolicyStatesQueryResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Query latest at subscription level policy assignment scope": { "$ref": "./examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json" } + } + } + }, + "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": { + "post": { + "operationId": "PolicyStates_SummarizeForSubscriptionLevelPolicyAssignment", + "description": "Summarizes policy states for the subscription level policy assignment.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesSummaryResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/authorizationNamespaceParameter" + }, + { + "$ref": "#/parameters/policyAssignmentNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "Summarize results.", + "schema": { + "$ref": "#/definitions/SummarizeResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Summarize at policy assignment scope": { "$ref": "./examples/PolicyStates_SummarizeSubscriptionLevelPolicyAssignmentScope.json" } + } + } + }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": { + "post": { + "operationId": "PolicyStates_ListQueryResultsForResourceGroupLevelPolicyAssignment", + "description": "Queries policy states for the resource group level policy assignment.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/authorizationNamespaceParameter" + }, + { + "$ref": "#/parameters/policyAssignmentNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/orderByParameter" + }, + { + "$ref": "#/parameters/selectParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + }, + { + "$ref": "#/parameters/applyParameter" + } + ], + "responses": { + "200": { + "description": "Query results.", + "schema": { + "$ref": "#/definitions/PolicyStatesQueryResults" + } + }, + "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": { "$ref": "./examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json" } + } + } + }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize": { + "post": { + "operationId": "PolicyStates_SummarizeForResourceGroupLevelPolicyAssignment", + "description": "Summarizes policy states for the resource group level policy assignment.", + "parameters": [ + { + "$ref": "#/parameters/policyStatesSummaryResourceParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/authorizationNamespaceParameter" + }, + { + "$ref": "#/parameters/policyAssignmentNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/topParameter" + }, + { + "$ref": "#/parameters/fromParameter" + }, + { + "$ref": "#/parameters/toParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "Summarize results.", + "schema": { + "$ref": "#/definitions/SummarizeResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Summarize at policy assignment scope": { "$ref": "./examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json" } + } + } + }, + "/providers/Microsoft.PolicyInsights/operations": { + "get": { + "operationId": "Operations_List", + "description": "Lists available operations.", + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "List of available operations.", + "schema": { + "$ref": "#/definitions/OperationsListResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "List operations": { "$ref": "./examples/PolicyStates_ListOperations.json" } + } + } + }, + "/{scope}/providers/Microsoft.PolicyInsights/policyStates/$metadata": { + "get": { + "operationId": "PolicyStates_GetMetadata", + "description": "Gets OData metadata XML document.", + "produces": [ + "application/xml" + ], + "parameters": [ + { + "$ref": "#/parameters/scopeParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OData metadata XML document.", + "schema": { + "$ref": "#/definitions/MetadataDocument" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Get metadata": { "$ref": "./examples/PolicyStates_GetMetadata.json" } + } + } + } + }, + "definitions": { + "PolicyStatesQueryResults": { + "description": "Query results.", + "properties": { + "@odata.context": { + "description": "OData context string; used by OData clients to resolve type information based on metadata.", + "type": "string" + }, + "@odata.count": { + "description": "OData entity count; represents the number of policy state records returned.", + "type": "integer", + "format": "int32", + "minimum": 0 + }, + "value": { + "description": "Query results.", + "type": "array", + "items": { + "$ref": "#/definitions/PolicyState" + } + } + } + }, + "PolicyState": { + "type": "object", + "description": "Policy state record.", + "properties": { + "@odata.id": { + "description": "OData entity ID; always set to null since policy state records do not have an entity ID.", + "type": "string" + }, + "@odata.context": { + "description": "OData context string; used by OData clients to resolve type information based on metadata.", + "type": "string" + }, + "timestamp": { + "description": "Timestamp for the policy state record.", + "type": "string", + "format": "date-time" + }, + "resourceId": { + "description": "Resource ID.", + "type": "string" + }, + "policyAssignmentId": { + "description": "Policy assignment ID.", + "type": "string" + }, + "policyDefinitionId": { + "description": "Policy definition ID.", + "type": "string" + }, + "effectiveParameters": { + "description": "Effective parameters for the policy assignment.", + "type": "string" + }, + "isCompliant": { + "description": "Flag which states whether the resource is compliant against the policy assignment it was evaluated against.", + "type": "boolean" + }, + "subscriptionId": { + "description": "Subscription ID.", + "type": "string" + }, + "resourceType": { + "description": "Resource type.", + "type": "string" + }, + "resourceLocation": { + "description": "Resource location.", + "type": "string" + }, + "resourceGroup": { + "description": "Resource group name.", + "type": "string" + }, + "resourceTags": { + "description": "List of resource tags.", + "type": "string" + }, + "policyAssignmentName": { + "description": "Policy assignment name.", + "type": "string" + }, + "policyAssignmentOwner": { + "description": "Policy assignment owner.", + "type": "string" + }, + "policyAssignmentParameters": { + "description": "Policy assignment parameters.", + "type": "string" + }, + "policyAssignmentScope": { + "description": "Policy assignment scope.", + "type": "string" + }, + "policyDefinitionName": { + "description": "Policy definition name.", + "type": "string" + }, + "policyDefinitionAction": { + "description": "Policy definition action, i.e. effect.", + "type": "string" + }, + "policyDefinitionCategory": { + "description": "Policy definition category.", + "type": "string" + }, + "policySetDefinitionId": { + "description": "Policy set definition ID, if the policy assignment is for a policy set.", + "type": "string" + }, + "policySetDefinitionName": { + "description": "Policy set definition name, if the policy assignment is for a policy set.", + "type": "string" + }, + "policySetDefinitionOwner": { + "description": "Policy set definition owner, if the policy assignment is for a policy set.", + "type": "string" + }, + "policySetDefinitionCategory": { + "description": "Policy set definition category, if the policy assignment is for a policy set.", + "type": "string" + }, + "policySetDefinitionParameters": { + "description": "Policy set definition parameters, if the policy assignment is for a policy set.", + "type": "string" + }, + "managementGroupIds": { + "description": "Comma separated list of management group IDs, which represent the hierarchy of the management groups the resource is under.", + "type": "string" + }, + "policyDefinitionReferenceId": { + "description": "Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.", + "type": "string" + }, + "complianceState": { + "description": "Compliance state of the resource.", + "type": "string" + }, + "policyEvaluationDetails": { + "description": "Policy evaluation details.", + "type": "object", + "$ref": "#/definitions/PolicyEvaluationDetails" + } + }, + "additionalProperties": { + "description": "The list of key/value pairs for the additional properties, in the format 'key':'value' where key = the field name, and value = the field value. By default this is not populated" + } + }, + "PolicyEvaluationDetails": { + "type": "object", + "description": "Policy evaluation details.", + "properties": { + "evaluatedExpressions": { + "description": "Details of the evaluated expressions.", + "type": "array", + "items": { + "$ref": "#/definitions/ExpressionEvaluationDetails" + } + }, + "ifNotExistsDetails": { + "description": "Evaluation details of IfNotExists effect.", + "type": "object", + "$ref": "#/definitions/IfNotExistsEvaluationDetails" + } + } + }, + "ExpressionEvaluationDetails": { + "type": "object", + "description": "Evaluation details of policy language expressions.", + "properties": { + "result": { + "description": "Evaluation result.", + "type": "string" + }, + "expression": { + "description": "Expression evaluated.", + "type": "string" + }, + "path": { + "description": "Property path if the expression is a field or an aliase.", + "type": "string" + }, + "expressionValue": { + "description": "Value of the expression.", + "type": "string" + }, + "targetValue": { + "description": "Target value to be compared with the expression value.", + "type": "string" + }, + "operator": { + "description": "Operator to compare the expression value and the target value.", + "type": "string" + } + } + }, + "IfNotExistsEvaluationDetails": { + "type": "object", + "description": "Evaluation details of IfNotExists effect.", + "properties": { + "resourceId": { + "description": "ID of the last evaluated resource for IfNotExists effect.", + "type": "string" + }, + "totalResources": { + "description": "Total number of resources to which the existence condition is applicable.", + "type": "integer" + } + } + }, + "SummarizeResults": { + "description": "Summarize action results.", + "properties": { + "@odata.context": { + "description": "OData context string; used by OData clients to resolve type information based on metadata.", + "type": "string" + }, + "@odata.count": { + "description": "OData entity count; represents the number of summaries returned; always set to 1.", + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1 + }, + "value": { + "description": "Summarize action results.", + "type": "array", + "items": { + "$ref": "#/definitions/Summary" + } + } + } + }, + "Summary": { + "description": "Summary results.", + "properties": { + "@odata.id": { + "description": "OData entity ID; always set to null since summaries do not have an entity ID.", + "type": "string" + }, + "@odata.context": { + "description": "OData context string; used by OData clients to resolve type information based on metadata.", + "type": "string" + }, + "results": { + "description": "Non-compliance summary for all policy assignments.", + "$ref": "#/definitions/SummaryResults" + }, + "policyAssignments": { + "description": "Policy assignments summary.", + "type": "array", + "items": { + "$ref": "#/definitions/PolicyAssignmentSummary" + } + } + } + }, + "SummaryResults": { + "description": "Non-compliance summary on a particular summary level.", + "properties": { + "queryResultsUri": { + "description": "HTTP POST URI for queryResults action on Microsoft.PolicyInsights to retrieve raw results for the non-compliance summary.", + "type": "string" + }, + "nonCompliantResources": { + "description": "Number of non-compliant resources.", + "type": "integer", + "format": "int32", + "minimum": 0 + }, + "nonCompliantPolicies": { + "description": "Number of non-compliant policies.", + "type": "integer", + "format": "int32", + "minimum": 0 + } + } + }, + "PolicyAssignmentSummary": { + "description": "Policy assignment summary.", + "properties": { + "policyAssignmentId": { + "description": "Policy assignment ID.", + "type": "string" + }, + "policySetDefinitionId": { + "description": "Policy set definition ID, if the policy assignment is for a policy set.", + "type": "string" + }, + "results": { + "description": "Non-compliance summary for the policy assignment.", + "$ref": "#/definitions/SummaryResults" + }, + "policyDefinitions": { + "description": "Policy definitions summary.", + "type": "array", + "items": { + "$ref": "#/definitions/PolicyDefinitionSummary" + } + } + } + }, + "PolicyDefinitionSummary": { + "description": "Policy definition summary.", + "properties": { + "policyDefinitionId": { + "description": "Policy definition ID.", + "type": "string" + }, + "policyDefinitionReferenceId": { + "description": "Policy definition reference ID.", + "type": "string" + }, + "effect": { + "description": "Policy effect, i.e. policy definition action.", + "type": "string" + }, + "results": { + "description": "Non-compliance summary for the policy definition.", + "$ref": "#/definitions/SummaryResults" + } + } + }, + "QueryFailure": { + "description": "Error response.", + "properties": { + "error": { + "description": "Error definition.", + "properties": { + "code": { + "description": "Service specific error code which serves as the substatus for the HTTP error code.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "Description of the error.", + "type": "string", + "readOnly": true + } + } + } + } + }, + "OperationsListResults": { + "description": "List of available operations.", + "properties": { + "@odata.count": { + "description": "OData entity count; represents the number of operations returned.", + "type": "integer", + "format": "int32", + "minimum": 1 + }, + "value": { + "description": "List of available operations.", + "type": "array", + "items": { + "$ref": "#/definitions/Operation" + } + } + } + }, + "Operation": { + "description": "Operation definition.", + "properties": { + "name": { + "description": "Operation name.", + "type": "string" + }, + "display": { + "description": "Display metadata associated with the operation.", + "properties": { + "provider": { + "description": "Resource provider name.", + "type": "string" + }, + "resource": { + "description": "Resource name on which the operation is performed.", + "type": "string" + }, + "operation": { + "description": "Operation name.", + "type": "string" + }, + "description": { + "description": "Operation description.", + "type": "string" + } + } + } + } + }, + "MetadataDocument": { + "description": "Metadata XML document.", + "type": "string" + } + }, + "parameters": { + "policyStatesResourceParameter": { + "name": "policyStatesResource", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "default", + "latest" + ], + "x-ms-enum": { + "name": "PolicyStatesResource", + "modelAsString": true + }, + "description": "The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s).", + "x-ms-parameter-location": "method" + }, + "policyStatesSummaryResourceParameter": { + "name": "policyStatesSummaryResource", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "latest" + ], + "description": "The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value.", + "x-ms-parameter-location": "method" + }, + "managementGroupsNamespaceParameter": { + "name": "managementGroupsNamespace", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "Microsoft.Management" + ], + "description": "The namespace for Microsoft Management RP; only \"Microsoft.Management\" is allowed.", + "x-ms-parameter-location": "method" + }, + "managementGroupNameParameter": { + "name": "managementGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "Management group name.", + "x-ms-parameter-location": "method" + }, + "subscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "Microsoft Azure subscription ID.", + "x-ms-parameter-location": "method" + }, + "resourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "Resource group name.", + "x-ms-parameter-location": "method" + }, + "resourceIdParameter": { + "name": "resourceId", + "in": "path", + "required": true, + "type": "string", + "description": "Resource ID.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "authorizationNamespaceParameter": { + "name": "authorizationNamespace", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "Microsoft.Authorization" + ], + "description": "The namespace for Microsoft Authorization resource provider; only \"Microsoft.Authorization\" is allowed.", + "x-ms-parameter-location": "method" + }, + "policySetDefinitionNameParameter": { + "name": "policySetDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "Policy set definition name.", + "x-ms-parameter-location": "method" + }, + "policyDefinitionNameParameter": { + "name": "policyDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "Policy definition name.", + "x-ms-parameter-location": "method" + }, + "policyAssignmentNameParameter": { + "name": "policyAssignmentName", + "in": "path", + "required": true, + "type": "string", + "description": "Policy assignment name.", + "x-ms-parameter-location": "method" + }, + "scopeParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "A valid scope, i.e. management group, subscription, resource group, or resource ID. Scope used has no effect on metadata returned.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "apiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "API version to use with the client requests.", + "x-ms-parameter-location": "client" + }, + "topParameter": { + "name": "$top", + "in": "query", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 0, + "description": "Maximum number of records to return.", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "QueryOptions" + }, + "x-ms-client-name": "Top" + }, + "orderByParameter": { + "name": "$orderby", + "in": "query", + "required": false, + "type": "string", + "description": "Ordering expression using OData notation. One or more comma-separated column names with an optional \"desc\" (the default) or \"asc\", e.g. \"$orderby=PolicyAssignmentId, ResourceId asc\".", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "QueryOptions" + }, + "x-ms-client-name": "OrderBy" + }, + "selectParameter": { + "name": "$select", + "in": "query", + "required": false, + "type": "string", + "description": "Select expression using OData notation. Limits the columns on each record to just those requested, e.g. \"$select=PolicyAssignmentId, ResourceId\".", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "QueryOptions" + }, + "x-ms-client-name": "Select" + }, + "fromParameter": { + "name": "$from", + "in": "query", + "required": false, + "type": "string", + "format": "date-time", + "description": "ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day).", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "QueryOptions" + }, + "x-ms-client-name": "From" + }, + "toParameter": { + "name": "$to", + "in": "query", + "required": false, + "type": "string", + "format": "date-time", + "description": "ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time.", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "QueryOptions" + }, + "x-ms-client-name": "To" + }, + "filterParameter": { + "name": "$filter", + "in": "query", + "required": false, + "type": "string", + "description": "OData filter expression.", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "QueryOptions" + }, + "x-ms-client-name": "Filter" + }, + "applyParameter": { + "name": "$apply", + "in": "query", + "required": false, + "type": "string", + "description": "OData apply expression for aggregations.", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "QueryOptions" + }, + "x-ms-client-name": "Apply" + }, + "expandParameter": { + "name": "$expand", + "in": "query", + "required": false, + "type": "string", + "description": "The $expand query parameter. For example, to expand policyEvaluationDetails, use $expand=policyEvaluationDetails", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "QueryOptions" + }, + "x-ms-client-name": "Expand" + } + } +} \ No newline at end of file diff --git a/specification/policyinsights/resource-manager/readme.md b/specification/policyinsights/resource-manager/readme.md index f57d8b086041..1578d675bd00 100644 --- a/specification/policyinsights/resource-manager/readme.md +++ b/specification/policyinsights/resource-manager/readme.md @@ -66,7 +66,7 @@ input-file: - Microsoft.PolicyInsights/preview/2018-07-01-preview/policyTrackedResources.json - Microsoft.PolicyInsights/preview/2018-07-01-preview/remediations.json - Microsoft.PolicyInsights/stable/2018-04-04/policyEvents.json -- Microsoft.PolicyInsights/stable/2018-04-04/policyStates.json +- Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json ```