@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api PolicyEventsClient
@base https://management.azure.com
@version 2018-04-04
@auth OAuth2
@common_fields {api-version: any # API version to use with the client requests.}
@endpoints 9
@toc providers(1), subscriptions(6), {resourceId}(1), {scope}(1)

@group providers
@endpoint POST /providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults
@desc Queries policy events for the resources under the management group.
@required {policyEventsResource: any # The name of the virtual resource under PolicyEvents resource type; only "default" is allowed., managementGroupsNamespace: any # The namespace for Microsoft Management RP; only "Microsoft.Management" is allowed., managementGroupName: any # Management group name.}
@optional {$top: any # Maximum number of records to return., $orderby: any # 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"., $select: any # Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId"., $from: any # ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day)., $to: any # ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time., $filter: any # OData filter expression., $apply: any # OData apply expression for aggregations.}
@returns(200) Query results.

@endgroup

@group subscriptions
@endpoint POST /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults
@desc Queries policy events for the resources under the subscription.
@required {policyEventsResource: any # The name of the virtual resource under PolicyEvents resource type; only "default" is allowed., subscriptionId: any # Microsoft Azure subscription ID.}
@optional {$top: any # Maximum number of records to return., $orderby: any # 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"., $select: any # Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId"., $from: any # ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day)., $to: any # ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time., $filter: any # OData filter expression., $apply: any # OData apply expression for aggregations.}
@returns(200) Query results.

@endpoint POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults
@desc Queries policy events for the resources under the resource group.
@required {policyEventsResource: any # The name of the virtual resource under PolicyEvents resource type; only "default" is allowed., subscriptionId: any # Microsoft Azure subscription ID., resourceGroupName: any # Resource group name.}
@optional {$top: any # Maximum number of records to return., $orderby: any # 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"., $select: any # Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId"., $from: any # ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day)., $to: any # ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time., $filter: any # OData filter expression., $apply: any # OData apply expression for aggregations.}
@returns(200) Query results.

@endgroup

@group {resourceId}
@endpoint POST /{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults
@desc Queries policy events for the resource.
@required {policyEventsResource: any # The name of the virtual resource under PolicyEvents resource type; only "default" is allowed., resourceId: any # Resource ID.}
@optional {$top: any # Maximum number of records to return., $orderby: any # 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"., $select: any # Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId"., $from: any # ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day)., $to: any # ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time., $filter: any # OData filter expression., $apply: any # OData apply expression for aggregations.}
@returns(200) Query results.

@endgroup

@group subscriptions
@endpoint POST /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults
@desc Queries policy events for the subscription level policy set definition.
@required {policyEventsResource: any # The name of the virtual resource under PolicyEvents resource type; only "default" is allowed., subscriptionId: any # Microsoft Azure subscription ID., authorizationNamespace: any # The namespace for Microsoft Authorization resource provider; only "Microsoft.Authorization" is allowed., policySetDefinitionName: any # Policy set definition name.}
@optional {$top: any # Maximum number of records to return., $orderby: any # 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"., $select: any # Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId"., $from: any # ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day)., $to: any # ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time., $filter: any # OData filter expression., $apply: any # OData apply expression for aggregations.}
@returns(200) Query results.

@endpoint POST /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults
@desc Queries policy events for the subscription level policy definition.
@required {policyEventsResource: any # The name of the virtual resource under PolicyEvents resource type; only "default" is allowed., subscriptionId: any # Microsoft Azure subscription ID., authorizationNamespace: any # The namespace for Microsoft Authorization resource provider; only "Microsoft.Authorization" is allowed., policyDefinitionName: any # Policy definition name.}
@optional {$top: any # Maximum number of records to return., $orderby: any # 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"., $select: any # Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId"., $from: any # ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day)., $to: any # ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time., $filter: any # OData filter expression., $apply: any # OData apply expression for aggregations.}
@returns(200) Query results.

@endpoint POST /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults
@desc Queries policy events for the subscription level policy assignment.
@required {policyEventsResource: any # The name of the virtual resource under PolicyEvents resource type; only "default" is allowed., subscriptionId: any # Microsoft Azure subscription ID., authorizationNamespace: any # The namespace for Microsoft Authorization resource provider; only "Microsoft.Authorization" is allowed., policyAssignmentName: any # Policy assignment name.}
@optional {$top: any # Maximum number of records to return., $orderby: any # 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"., $select: any # Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId"., $from: any # ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day)., $to: any # ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time., $filter: any # OData filter expression., $apply: any # OData apply expression for aggregations.}
@returns(200) Query results.

@endpoint POST /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults
@desc Queries policy events for the resource group level policy assignment.
@required {policyEventsResource: any # The name of the virtual resource under PolicyEvents resource type; only "default" is allowed., subscriptionId: any # Microsoft Azure subscription ID., resourceGroupName: any # Resource group name., authorizationNamespace: any # The namespace for Microsoft Authorization resource provider; only "Microsoft.Authorization" is allowed., policyAssignmentName: any # Policy assignment name.}
@optional {$top: any # Maximum number of records to return., $orderby: any # 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"., $select: any # Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId"., $from: any # ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day)., $to: any # ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time., $filter: any # OData filter expression., $apply: any # OData apply expression for aggregations.}
@returns(200) Query results.

@endgroup

@group {scope}
@endpoint GET /{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata
@desc Gets OData metadata XML document.
@required {scope: any # A valid scope, i.e. management group, subscription, resource group, or resource ID. Scope used has no effect on metadata returned.}
@returns(200) OData metadata XML document.

@endgroup

@end
