{ "swagger": "2.0", "info": { "title": "PolicyStatesClient", "version": "2019-10-01" }, "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" }, { "$ref": "#/parameters/skipTokenParameter" } ], "responses": { "200": { "description": "Query results.", "schema": { "$ref": "#/definitions/PolicyStatesQueryResults" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/QueryFailure" } } }, "x-ms-pageable": { "nextLinkName": "@odata.nextLink", "operationName": "PolicyStates_NextLink" }, "x-ms-examples": { "Query latest at management group scope": { "$ref": "./examples/PolicyStates_QueryManagementGroupScope.json" }, "Query latest at management group scope with next link": { "$ref": "./examples/PolicyStates_QueryManagementGroupScopeNextLink.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/subscriptionId" }, { "$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/skipTokenParameter" } ], "responses": { "200": { "description": "Query results.", "schema": { "$ref": "#/definitions/PolicyStatesQueryResults" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/QueryFailure" } } }, "x-ms-pageable": { "nextLinkName": "@odata.nextLink", "operationName": "PolicyStates_NextLink" }, "x-ms-examples": { "Query latest at subscription scope": { "$ref": "./examples/PolicyStates_QuerySubscriptionScope.json" }, "Query latest at subscription scope with next link": { "$ref": "./examples/PolicyStates_QuerySubscriptionScopeNextLink.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/subscriptionId" }, { "$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" }, "Summarize at subscription scope for a policy definition group": { "$ref": "./examples/PolicyStates_SummarizeSubscriptionScopeForPolicyGroup.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/subscriptionId" }, { "$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" }, { "$ref": "#/parameters/skipTokenParameter" } ], "responses": { "200": { "description": "Query results.", "schema": { "$ref": "#/definitions/PolicyStatesQueryResults" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/QueryFailure" } } }, "x-ms-pageable": { "nextLinkName": "@odata.nextLink", "operationName": "PolicyStates_NextLink" }, "x-ms-examples": { "Query latest at resource group scope": { "$ref": "./examples/PolicyStates_QueryResourceGroupScope.json" }, "Query latest at resource group scope with next link": { "$ref": "./examples/PolicyStates_QueryResourceGroupScopeNextLink.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/subscriptionId" }, { "$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" }, { "$ref": "#/parameters/skipTokenParameter" } ], "responses": { "200": { "description": "Query results.", "schema": { "$ref": "#/definitions/PolicyStatesQueryResults" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/QueryFailure" } } }, "x-ms-pageable": { "nextLinkName": "@odata.nextLink", "operationName": "PolicyStates_NextLink" }, "x-ms-examples": { "Query all policy states at resource scope": { "$ref": "./examples/PolicyStates_QueryResourceScope.json" }, "Query all policy states at resource scope with next link": { "$ref": "./examples/PolicyStates_QueryResourceScopeNextLink.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" }, "Query component policy compliance state at resource scope filtered by given assignment.": { "$ref": "./examples/PolicyStates_QueryResourceScopeExpandComponents.json" }, "Query component policy compliance state count grouped by state type at resource scope filtered by given assignment.": { "$ref": "./examples/PolicyStates_QueryResourceScopeExpandComponentsGroupByWithAggregate.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/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation": { "post": { "operationId": "PolicyStates_TriggerSubscriptionEvaluation", "description": "Triggers a policy evaluation scan for all the resources under the subscription", "parameters": [ { "$ref": "#/parameters/subscriptionId" }, { "$ref": "#/parameters/apiVersionParameter" } ], "responses": { "200": { "description": "The scan is done." }, "202": { "description": "The scan was successfully triggered." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/QueryFailure" } } }, "x-ms-examples": { "Trigger evaluations for all resources in a subscription": { "$ref": "./examples/PolicyStates_TriggerSubscriptionEvaluation.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation": { "post": { "operationId": "PolicyStates_TriggerResourceGroupEvaluation", "description": "Triggers a policy evaluation scan for all the resources under the resource group.", "parameters": [ { "$ref": "#/parameters/subscriptionId" }, { "$ref": "#/parameters/resourceGroupNameParameter" }, { "$ref": "#/parameters/apiVersionParameter" } ], "responses": { "200": { "description": "The scan is done." }, "202": { "description": "The scan was successfully triggered." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/QueryFailure" } } }, "x-ms-examples": { "Trigger evaluations for all resources in a resource group": { "$ref": "./examples/PolicyStates_TriggerResourceGroupEvaluation.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/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/subscriptionId" }, { "$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" }, { "$ref": "#/parameters/skipTokenParameter" } ], "responses": { "200": { "description": "Query results.", "schema": { "$ref": "#/definitions/PolicyStatesQueryResults" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/QueryFailure" } } }, "x-ms-pageable": { "nextLinkName": "@odata.nextLink", "operationName": "PolicyStates_NextLink" }, "x-ms-examples": { "Query latest at subscription level policy set definition scope": { "$ref": "./examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json" }, "Query latest at subscription level policy set definition scope with next link": { "$ref": "./examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.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/subscriptionId" }, { "$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/subscriptionId" }, { "$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" }, { "$ref": "#/parameters/skipTokenParameter" } ], "responses": { "200": { "description": "Query results.", "schema": { "$ref": "#/definitions/PolicyStatesQueryResults" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/QueryFailure" } } }, "x-ms-pageable": { "nextLinkName": "@odata.nextLink", "operationName": "PolicyStates_NextLink" }, "x-ms-examples": { "Query latest at subscription level policy definition scope": { "$ref": "./examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json" }, "Query latest at subscription level policy definition scope with next link": { "$ref": "./examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.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/subscriptionId" }, { "$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/subscriptionId" }, { "$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" }, { "$ref": "#/parameters/skipTokenParameter" } ], "responses": { "200": { "description": "Query results.", "schema": { "$ref": "#/definitions/PolicyStatesQueryResults" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/QueryFailure" } } }, "x-ms-pageable": { "nextLinkName": "@odata.nextLink", "operationName": "PolicyStates_NextLink" }, "x-ms-examples": { "Query latest at subscription level policy assignment scope": { "$ref": "./examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json" }, "Query latest at subscription level policy assignment scope with next link": { "$ref": "./examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.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/subscriptionId" }, { "$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/subscriptionId" }, { "$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" }, { "$ref": "#/parameters/skipTokenParameter" } ], "responses": { "200": { "description": "Query results.", "schema": { "$ref": "#/definitions/PolicyStatesQueryResults" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/QueryFailure" } } }, "x-ms-pageable": { "nextLinkName": "@odata.nextLink", "operationName": "PolicyStates_NextLink" }, "x-ms-examples": { "Query latest at resource group level policy assignment scope": { "$ref": "./examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json" }, "Query latest at resource group level policy assignment scope with next link": { "$ref": "./examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.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/subscriptionId" }, { "$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" } } } } }, "x-ms-paths": { "{nextLink}?Next paging op for policy states": { "post": { "operationId": "PolicyStates_NextLink", "description": "Subsequent post calls to the next link", "parameters": [ { "$ref": "#/parameters/apiVersionParameter" }, { "$ref": "#/parameters/skipTokenParameter" }, { "name": "nextLink", "in": "path", "required": true, "type": "string", "description": "Next link for list operation.", "x-ms-skip-url-encoding": true } ], "responses": { "200": { "description": "Query results.", "schema": { "$ref": "#/definitions/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 with next link": { "$ref": "./examples/PolicyStates_QueryManagementGroupScopeNextLinkSkipToken.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 }, "@odata.nextLink": { "description": "Odata next link; URL to get the next set of results.", "type": "string" }, "value": { "description": "Query results.", "type": "array", "items": { "$ref": "#/definitions/PolicyState" }, "x-ms-identifiers": [] } } }, "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. This property is deprecated; please use ComplianceState instead.", "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" }, "policyDefinitionGroupNames": { "description": "Policy definition group names.", "type": "array", "items": { "type": "string" } }, "components": { "description": "Components state compliance records populated only when URL contains $expand=components clause.", "type": "array", "items": { "$ref": "#/definitions/ComponentStateDetails" } }, "policyDefinitionVersion": { "description": "Evaluated policy definition version.", "type": "string", "readOnly": true }, "policySetDefinitionVersion": { "description": "Evaluated policy set definition version.", "type": "string", "readOnly": true }, "policyAssignmentVersion": { "description": "Evaluated policy assignment version.", "type": "string", "readOnly": true } }, "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" }, "x-ms-identifiers": [] }, "ifNotExistsDetails": { "description": "Evaluation details of IfNotExists effect.", "type": "object", "$ref": "#/definitions/IfNotExistsEvaluationDetails" } } }, "ComponentStateDetails": { "type": "object", "description": "Component state details.", "properties": { "id": { "description": "Component Id.", "type": "string" }, "type": { "description": "Component type.", "type": "string" }, "name": { "description": "Component name.", "type": "string" }, "timestamp": { "description": "Component compliance evaluation timestamp.", "type": "string", "format": "date-time" }, "complianceState": { "description": "Component compliance state.", "type": "string" } }, "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" } }, "ExpressionEvaluationDetails": { "type": "object", "description": "Evaluation details of policy language expressions.", "properties": { "result": { "description": "Evaluation result.", "type": "string" }, "expression": { "description": "Expression evaluated.", "type": "string" }, "expressionKind": { "description": "The kind of expression that was evaluated.", "type": "string", "readOnly": true }, "path": { "description": "Property path if the expression is a field or an alias.", "type": "string" }, "expressionValue": { "description": "Value of the expression.", "type": "object" }, "targetValue": { "description": "Target value to be compared with the expression value.", "type": "object" }, "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" }, "x-ms-identifiers": [] } } }, "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": "Compliance summary for all policy assignments.", "$ref": "#/definitions/SummaryResults" }, "policyAssignments": { "description": "Policy assignments summary.", "type": "array", "items": { "$ref": "#/definitions/PolicyAssignmentSummary" }, "x-ms-identifiers": [ "policyAssignmentId" ] } } }, "SummaryResults": { "description": "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 compliance summary. This property will not be available by default in future API versions, but could be queried explicitly.", "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 }, "resourceDetails": { "description": "The resources summary at this level.", "type": "array", "items": { "$ref": "#/definitions/ComplianceDetail" }, "x-ms-identifiers": [] }, "policyDetails": { "description": "The policy artifact summary at this level. For query scope level, it represents policy assignment summary. For policy assignment level, it represents policy definitions summary.", "type": "array", "items": { "$ref": "#/definitions/ComplianceDetail" }, "x-ms-identifiers": [] }, "policyGroupDetails": { "description": "The policy definition group summary at this level.", "type": "array", "items": { "$ref": "#/definitions/ComplianceDetail" }, "x-ms-identifiers": [] } } }, "ComplianceDetail": { "description": "The compliance state rollup.", "properties": { "complianceState": { "description": "The compliance state.", "type": "string" }, "count": { "description": "Summarized count value for this compliance state.", "type": "integer", "format": "int32" } } }, "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": "Compliance summary for the policy assignment.", "$ref": "#/definitions/SummaryResults" }, "policyDefinitions": { "description": "Policy definitions summary.", "type": "array", "items": { "$ref": "#/definitions/PolicyDefinitionSummary" }, "x-ms-identifiers": [ "policyDefinitionId" ] }, "policyGroups": { "description": "Policy definition group summary.", "type": "array", "items": { "$ref": "#/definitions/PolicyGroupSummary" }, "x-ms-identifiers": [ "policyGroupName" ] } } }, "PolicyDefinitionSummary": { "description": "Policy definition summary.", "properties": { "policyDefinitionId": { "description": "Policy definition ID.", "type": "string" }, "policyDefinitionReferenceId": { "description": "Policy definition reference ID.", "type": "string" }, "policyDefinitionGroupNames": { "description": "Policy definition group names.", "type": "array", "items": { "type": "string" } }, "effect": { "description": "Policy effect, i.e. policy definition action.", "type": "string" }, "results": { "description": "Compliance summary for the policy definition.", "$ref": "#/definitions/SummaryResults" } } }, "PolicyGroupSummary": { "description": "Policy definition group summary.", "properties": { "policyGroupName": { "description": "Policy group name.", "type": "string" }, "results": { "description": "Compliance summary for the policy definition group.", "$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 } } } } }, "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" ], "x-ms-enum": { "name": "PolicyStatesSummaryResourceType", "modelAsString": true }, "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" ], "x-ms-enum": { "name": "ManagementGroupsNamespaceType", "modelAsString": false }, "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" }, "subscriptionId": { "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" ], "x-ms-enum": { "name": "AuthorizationNamespaceType", "modelAsString": false }, "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": "Client Api Version.", "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 components use $expand=components", "x-ms-parameter-location": "method", "x-ms-parameter-grouping": { "name": "QueryOptions" }, "x-ms-client-name": "Expand" }, "skipTokenParameter": { "name": "$skiptoken", "in": "query", "required": false, "type": "string", "description": "Skiptoken is only provided if a previous response returned a partial result as a part of nextLink element.", "x-ms-parameter-location": "method", "x-ms-parameter-grouping": { "name": "QueryOptions" }, "x-ms-client-name": "SkipToken" } } }