swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  title: PolicyStatesClient
  version: 2017-08-09-preview
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2017-08-09-preview/policyStates.json
      version: "2.0"
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: policyinsights-policyStates
  x-tags:
    - Azure
    - Microsoft
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters:
  apiVersionParameter:
    description: API version to use with the client requests.
    in: query
    name: api-version
    required: true
    type: string
    x-ms-parameter-location: client
  applyParameter:
    description: OData apply expression for aggregations.
    in: query
    name: $apply
    required: false
    type: string
    x-ms-client-name: Apply
    x-ms-parameter-grouping:
      name: QueryOptions
    x-ms-parameter-location: method
  filterParameter:
    description: OData filter expression.
    in: query
    name: $filter
    required: false
    type: string
    x-ms-client-name: Filter
    x-ms-parameter-grouping:
      name: QueryOptions
    x-ms-parameter-location: method
  fromParameter:
    description: ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day).
    format: date-time
    in: query
    name: $from
    required: false
    type: string
    x-ms-client-name: From
    x-ms-parameter-grouping:
      name: QueryOptions
    x-ms-parameter-location: method
  managementGroupNameParameter:
    description: Management group name.
    in: path
    name: managementGroupName
    required: true
    type: string
    x-ms-parameter-location: method
  managementGroupsNamespaceParameter:
    description: The namespace for Microsoft Management resource provider; only "Microsoft.Management" is allowed.
    enum:
      - Microsoft.Management
    in: path
    name: managementGroupsNamespace
    required: true
    type: string
    x-ms-parameter-location: method
  orderByParameter:
    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".
    in: query
    name: $orderby
    required: false
    type: string
    x-ms-client-name: OrderBy
    x-ms-parameter-grouping:
      name: QueryOptions
    x-ms-parameter-location: method
  policyStatesResourceParameter:
    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).
    enum:
      - default
      - latest
    in: path
    name: policyStatesResource
    required: true
    type: string
    x-ms-enum:
      modelAsString: true
      name: PolicyStatesResource
    x-ms-parameter-location: method
  resourceGroupNameParameter:
    description: Resource group name.
    in: path
    name: resourceGroupName
    required: true
    type: string
    x-ms-parameter-location: method
  resourceIdParameter:
    description: Resource ID.
    in: path
    name: resourceId
    required: true
    type: string
    x-ms-parameter-location: method
    x-ms-skip-url-encoding: true
  selectParameter:
    description: Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId".
    in: query
    name: $select
    required: false
    type: string
    x-ms-client-name: Select
    x-ms-parameter-grouping:
      name: QueryOptions
    x-ms-parameter-location: method
  subscriptionIdParameter:
    description: Microsoft Azure subscription ID.
    in: path
    name: subscriptionId
    required: true
    type: string
    x-ms-parameter-location: method
  toParameter:
    description: ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time.
    format: date-time
    in: query
    name: $to
    required: false
    type: string
    x-ms-client-name: To
    x-ms-parameter-grouping:
      name: QueryOptions
    x-ms-parameter-location: method
  topParameter:
    description: Maximum number of records to return.
    format: int32
    in: query
    minimum: 0
    name: $top
    required: false
    type: integer
    x-ms-client-name: Top
    x-ms-parameter-grouping:
      name: QueryOptions
    x-ms-parameter-location: method
paths:
  /providers/Microsoft.PolicyInsights/operations:
    get:
      description: Lists available operations.
      operationId: Operations_List
      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:
          parameters:
            api-version: 2017-08-09-preview
          responses:
            "200":
              body:
                value:
                  - display:
                      description: Query information about policy events.
                      operation: Query Policy Events
                      provider: Microsoft Policy Insights
                      resource: Policy Events
                    name: default/queryResults/action
                  - display:
                      description: Query information about policy states.
                      operation: Query Policy States
                      provider: Microsoft Policy Insights
                      resource: Policy States
                    name: default/queryResults/action
                  - display:
                      description: Query information about policy latest states.
                      operation: Query Policy Latest States
                      provider: Microsoft Policy Insights
                      resource: Policy Latest States
                    name: latest/queryResults/action
  "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults":
    post:
      description: Queries policy states for the resources under the management group.
      operationId: PolicyStates_ListQueryResultsForManagementGroup
      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:
          parameters:
            api-version: 2017-08-09-preview
            managementGroupName: myManagementGroup
            managementGroupsNamespace: Microsoft.Management
            policyStatesResource: latest
          responses:
            "200":
              body:
                value:
                  - columns:
                      EffectiveParameters:
                        dataType: String
                        name: EffectiveParameters
                        ordinal: 5
                      IsCompliant:
                        dataType: Boolean
                        name: IsCompliant
                        ordinal: 6
                      ManagementGroupIds:
                        dataType: String
                        name: ManagementGroupIds
                        ordinal: 24
                      PolicyAssignmentId:
                        dataType: String
                        name: PolicyAssignmentId
                        ordinal: 3
                      PolicyAssignmentName:
                        dataType: String
                        name: PolicyAssignmentName
                        ordinal: 12
                      PolicyAssignmentOwner:
                        dataType: String
                        name: PolicyAssignmentOwner
                        ordinal: 13
                      PolicyAssignmentParameters:
                        dataType: String
                        name: PolicyAssignmentParameters
                        ordinal: 14
                      PolicyAssignmentScope:
                        dataType: String
                        name: PolicyAssignmentScope
                        ordinal: 15
                      PolicyDefinitionAction:
                        dataType: String
                        name: PolicyDefinitionAction
                        ordinal: 17
                      PolicyDefinitionCategory:
                        dataType: String
                        name: PolicyDefinitionCategory
                        ordinal: 18
                      PolicyDefinitionId:
                        dataType: String
                        name: PolicyDefinitionId
                        ordinal: 4
                      PolicyDefinitionName:
                        dataType: String
                        name: PolicyDefinitionName
                        ordinal: 16
                      PolicyDefinitionReferenceId:
                        dataType: String
                        name: PolicyDefinitionReferenceId
                        ordinal: 25
                      PolicySetDefinitionCategory:
                        dataType: String
                        name: PolicySetDefinitionCategory
                        ordinal: 22
                      PolicySetDefinitionId:
                        dataType: String
                        name: PolicySetDefinitionId
                        ordinal: 19
                      PolicySetDefinitionName:
                        dataType: String
                        name: PolicySetDefinitionName
                        ordinal: 20
                      PolicySetDefinitionOwner:
                        dataType: String
                        name: PolicySetDefinitionOwner
                        ordinal: 21
                      PolicySetDefinitionParameters:
                        dataType: String
                        name: PolicySetDefinitionParameters
                        ordinal: 23
                      ResourceGroup:
                        dataType: String
                        name: ResourceGroup
                        ordinal: 10
                      ResourceId:
                        dataType: String
                        name: ResourceId
                        ordinal: 2
                      ResourceLocation:
                        dataType: String
                        name: ResourceLocation
                        ordinal: 9
                      ResourceTags:
                        dataType: String
                        name: ResourceTags
                        ordinal: 11
                      ResourceType:
                        dataType: String
                        name: ResourceType
                        ordinal: 8
                      SubscriptionId:
                        dataType: String
                        name: SubscriptionId
                        ordinal: 7
                      Timestamp:
                        dataType: DateTime
                        name: Timestamp
                        ordinal: 1
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - 2018-02-08T23:19:37Z
                        - /subscriptions/fff83be3-fff8-fff8-fff5-fff2625f5bb5/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myResourceGroup-vnet
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/8174043a1e2849179635b874
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066
                        - null
                        - false
                        - fff83be3-fff8-fff8-fff5-fff2625f5bb5
                        - /Microsoft.Network/virtualNetworks
                        - westcentralus
                        - myResourceGroup
                        - tbd
                        - 8174043a1e2849179635b874
                        - tbd
                        - '{"allowedResourceGroups":{"value":["value1","value2","value3"]}}'
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup
                        - 72c0c41a-c752-4bc0-9c61-0d6adc567066
                        - audit
                        - tbd
                        - null
                        - null
                        - null
                        - null
                        - null
                        - myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
                      - - 2018-02-08T23:19:37Z
                        - /subscriptions/fff83be3-fff8-fff8-fff5-fff2625f5bb5/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myResourceGroup-vnet
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/95816fce53454b15a7ed803d
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/a2c0414b-82e4-459d-97d5-94c79a89232c
                        - null
                        - false
                        - fff83be3-fff8-fff8-fff5-fff2625f5bb5
                        - /Microsoft.Network/virtualNetworks
                        - westcentralus
                        - myResourceGroup
                        - tbd
                        - 95816fce53454b15a7ed803d
                        - tbd
                        - '{"allowedLocations":{"value":["eastus"]}}'
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup
                        - a2c0414b-82e4-459d-97d5-94c79a89232c
                        - audit
                        - tbd
                        - null
                        - null
                        - null
                        - null
                        - null
                        - myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
  "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults":
    post:
      description: Queries policy states for the resources under the subscription.
      operationId: PolicyStates_ListQueryResultsForSubscription
      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:
        Filter and aggregate only:
          parameters:
            $apply: aggregate($count as NumDenyStates)
            $filter: PolicyDefinitionAction eq 'deny'
            $from: 2018-02-05T18:00:00Z
            api-version: 2017-08-09-preview
            policyStatesResource: latest
            subscriptionId: fffedd8f-ffff-fffd-fffd-fffed2f84852
          responses:
            "200":
              body:
                value:
                  - columns:
                      NumDenyStates:
                        dataType: Numeric
                        name: NumDenyStates
                        ordinal: 1
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - 12
        Filter and group with aggregate:
          parameters:
            $apply: groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumAuditDenyNonComplianceRecords))
            $filter: IsCompliant eq false and (PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny')
            $from: 2018-02-05T18:00:00Z
            $orderby: NumAuditDenyNonComplianceRecords desc
            $top: 2
            api-version: 2017-08-09-preview
            policyStatesResource: latest
            subscriptionId: fffedd8f-ffff-fffd-fffd-fffed2f84852
          responses:
            "200":
              body:
                value:
                  - columns:
                      NumAuditDenyNonComplianceRecords:
                        dataType: Numeric
                        name: NumAuditDenyNonComplianceRecords
                        ordinal: 5
                      PolicyAssignmentId:
                        dataType: String
                        name: PolicyAssignmentId
                        ordinal: 1
                      PolicyDefinitionAction:
                        dataType: String
                        name: PolicyDefinitionAction
                        ordinal: 3
                      PolicyDefinitionId:
                        dataType: String
                        name: PolicyDefinitionId
                        ordinal: 2
                      ResourceId:
                        dataType: String
                        name: ResourceId
                        ordinal: 4
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474
                        - audit
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.classiccompute/domainnames/myDomainName
                        - 8
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1
                        - audit
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.classiccompute/domainnames/myDomainName
                        - 8
        Filter and group without aggregate:
          parameters:
            $apply: groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))
            $filter: IsCompliant eq false and (PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append')
            $from: 2018-01-05T18:00:00Z
            $top: 2
            api-version: 2017-08-09-preview
            policyStatesResource: latest
            subscriptionId: fffedd8f-ffff-fffd-fffd-fffed2f84852
          responses:
            "200":
              body:
                value:
                  - columns:
                      PolicyAssignmentId:
                        dataType: String
                        name: PolicyAssignmentId
                        ordinal: 1
                      PolicyDefinitionAction:
                        dataType: String
                        name: PolicyDefinitionAction
                        ordinal: 3
                      PolicyDefinitionId:
                        dataType: String
                        name: PolicyDefinitionId
                        ordinal: 2
                      ResourceId:
                        dataType: String
                        name: ResourceId
                        ordinal: 4
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ec8f9645-8ecb-4abb-9c0b-5292f19d4003
                        - /providers/microsoft.authorization/policydefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed
                        - auditifnotexists
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.network/virtualnetworks/vnet
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d15545b8-ff50-409a-a6e3-5bd5cc954003
                        - /providers/microsoft.authorization/policydefinitions/44452482-524f-4bf4-b852-0bff7cc4a3ed
                        - auditifnotexists
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.network/virtualnetworks/vnet
        Filter and multiple groups:
          parameters:
            $apply: groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId, ResourceId))/groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId), aggregate($count as NumNonCompliantResources))
            $filter: IsCompliant eq false
            $orderby: NumNonCompliantResources desc
            $top: 10
            api-version: 2017-08-09-preview
            policyStatesResource: latest
            subscriptionId: fffedd8f-ffff-fffd-fffd-fffed2f84852
          responses:
            "200":
              body:
                value:
                  - columns:
                      NumNonCompliantResources:
                        dataType: Numeric
                        name: NumNonCompliantResources
                        ordinal: 5
                      PolicyAssignmentId:
                        dataType: String
                        name: PolicyAssignmentId
                        ordinal: 1
                      PolicyDefinitionId:
                        dataType: String
                        name: PolicyDefinitionId
                        ordinal: 3
                      PolicyDefinitionReferenceId:
                        dataType: String
                        name: PolicyDefinitionReferenceId
                        ordinal: 4
                      PolicySetDefinitionId:
                        dataType: String
                        name: PolicySetDefinitionId
                        ordinal: 2
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1
                        - "1679708035638239273"
                        - 557
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1
                        - "14799174781370023846"
                        - 557
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1
                        - "1679708035638239273"
                        - 557
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/dcda79d769674aea8bfcaa49
                        - ""
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474
                        - ""
                        - 557
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d9da7e80af6344ab9d342aa7
                        - ""
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1
                        - ""
                        - 557
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/ddd8ef92e3714a5ea3d208c1
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1
                        - "14799174781370023846"
                        - 557
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1
                        - ""
                        - 552
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/e46af646ebdb461dba708e01
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/a03db67e-a286-43c3-9098-b2da83d361ad
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474
                        - "8935913113203900114"
                        - 544
                      - - /providers/microsoft.management/managementgroups/azgovtest1/providers/microsoft.authorization/policyassignments/8174043a1e2849179635b874
                        - ""
                        - /providers/microsoft.management/managementgroups/azgovtest1/providers/microsoft.authorization/policydefinitions/72c0c41a-c752-4bc0-9c61-0d6adc567066
                        - ""
                        - 526
                      - - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/f4cc58b7db524a9799381531
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policysetdefinitions/12b58873-e0f8-4b95-936c-86cbe7c9d697
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/c8b79b49-a579-4045-984e-1b249ab8b474
                        - "2124621540977569058"
                        - 509
        Query latest at subscription scope:
          parameters:
            api-version: 2017-08-09-preview
            policyStatesResource: latest
            subscriptionId: fffedd8f-ffff-fffd-fffd-fffed2f84852
          responses:
            "200":
              body:
                value:
                  - columns:
                      EffectiveParameters:
                        dataType: String
                        name: EffectiveParameters
                        ordinal: 5
                      IsCompliant:
                        dataType: Boolean
                        name: IsCompliant
                        ordinal: 6
                      ManagementGroupIds:
                        dataType: String
                        name: ManagementGroupIds
                        ordinal: 24
                      PolicyAssignmentId:
                        dataType: String
                        name: PolicyAssignmentId
                        ordinal: 3
                      PolicyAssignmentName:
                        dataType: String
                        name: PolicyAssignmentName
                        ordinal: 12
                      PolicyAssignmentOwner:
                        dataType: String
                        name: PolicyAssignmentOwner
                        ordinal: 13
                      PolicyAssignmentParameters:
                        dataType: String
                        name: PolicyAssignmentParameters
                        ordinal: 14
                      PolicyAssignmentScope:
                        dataType: String
                        name: PolicyAssignmentScope
                        ordinal: 15
                      PolicyDefinitionAction:
                        dataType: String
                        name: PolicyDefinitionAction
                        ordinal: 17
                      PolicyDefinitionCategory:
                        dataType: String
                        name: PolicyDefinitionCategory
                        ordinal: 18
                      PolicyDefinitionId:
                        dataType: String
                        name: PolicyDefinitionId
                        ordinal: 4
                      PolicyDefinitionName:
                        dataType: String
                        name: PolicyDefinitionName
                        ordinal: 16
                      PolicyDefinitionReferenceId:
                        dataType: String
                        name: PolicyDefinitionReferenceId
                        ordinal: 25
                      PolicySetDefinitionCategory:
                        dataType: String
                        name: PolicySetDefinitionCategory
                        ordinal: 22
                      PolicySetDefinitionId:
                        dataType: String
                        name: PolicySetDefinitionId
                        ordinal: 19
                      PolicySetDefinitionName:
                        dataType: String
                        name: PolicySetDefinitionName
                        ordinal: 20
                      PolicySetDefinitionOwner:
                        dataType: String
                        name: PolicySetDefinitionOwner
                        ordinal: 21
                      PolicySetDefinitionParameters:
                        dataType: String
                        name: PolicySetDefinitionParameters
                        ordinal: 23
                      ResourceGroup:
                        dataType: String
                        name: ResourceGroup
                        ordinal: 10
                      ResourceId:
                        dataType: String
                        name: ResourceId
                        ordinal: 2
                      ResourceLocation:
                        dataType: String
                        name: ResourceLocation
                        ordinal: 9
                      ResourceTags:
                        dataType: String
                        name: ResourceTags
                        ordinal: 11
                      ResourceType:
                        dataType: String
                        name: ResourceType
                        ordinal: 8
                      SubscriptionId:
                        dataType: String
                        name: SubscriptionId
                        ordinal: 7
                      Timestamp:
                        dataType: DateTime
                        name: Timestamp
                        ordinal: 1
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - 2018-02-08T23:26:49Z
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication/services/myService
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d
                        - null
                        - false
                        - fffedd8f-ffff-fffd-fffd-fffed2f84852
                        - /Microsoft.ServiceFabric/clusters/applications/services
                        - eastus
                        - myResourceGroup
                        - tbd
                        - 186044306c044a1d8c0ff76c
                        - tbd
                        - '{"allowedLocations":{"value":["centralus"]}}'
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup
                        - 022d9357-5a90-46f7-9554-21d30ce4c32d
                        - audit
                        - tbd
                        - null
                        - null
                        - null
                        - null
                        - null
                        - myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
                      - - 2018-02-08T23:26:49Z
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d
                        - null
                        - false
                        - fffedd8f-ffff-fffd-fffd-fffed2f84852
                        - /Microsoft.ServiceFabric/clusters/applications
                        - eastus
                        - myResourceGroup
                        - tbd
                        - 186044306c044a1d8c0ff76c
                        - tbd
                        - '{"allowedLocations":{"value":["centralus"]}}'
                        - /providers/Microsoft.Management/managementGroups/myManagementGroup
                        - 022d9357-5a90-46f7-9554-21d30ce4c32d
                        - audit
                        - tbd
                        - null
                        - null
                        - null
                        - null
                        - null
                        - myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
        "Time range; sort, select and limit":
          parameters:
            $from: 2018-02-05T18:00:00Z
            $orderby: Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId
            $select: Timestamp, PolicyAssignmentId, PolicyDefinitionId, SubscriptionId, ResourceGroup, ResourceId
            $to: 2018-02-06T18:00:00Z
            $top: 2
            api-version: 2017-08-09-preview
            policyStatesResource: latest
            subscriptionId: fffedd8f-ffff-fffd-fffd-fffed2f84852
          responses:
            "200":
              body:
                value:
                  - columns:
                      PolicyAssignmentId:
                        dataType: String
                        name: PolicyAssignmentId
                        ordinal: 2
                      PolicyDefinitionId:
                        dataType: String
                        name: PolicyDefinitionId
                        ordinal: 3
                      ResourceGroup:
                        dataType: String
                        name: ResourceGroup
                        ordinal: 5
                      ResourceId:
                        dataType: String
                        name: ResourceId
                        ordinal: 6
                      SubscriptionId:
                        dataType: String
                        name: SubscriptionId
                        ordinal: 4
                      Timestamp:
                        dataType: DateTime
                        name: Timestamp
                        ordinal: 1
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - 2018-02-06T17:58:00Z
                        - /providers/Microsoft.Management/managementGroups/8cb1e007-947f-423a-ad0c-7ab7dc7d0255/providers/Microsoft.Authorization/policyAssignments/1654a0254ab34920a60f94eb
                        - /providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759
                        - fffedd8f-ffff-fffd-fffd-fffed2f84852
                        - myResourceGroup1
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup1/providers/Microsoft.Storage/storageAccounts/mysa1
                      - - 2018-02-06T17:58:00Z
                        - /providers/Microsoft.Management/managementGroups/8cb1e007-947f-423a-ad0c-7ab7dc7d0255/providers/Microsoft.Authorization/policyAssignments/1654a0254ab34920a60f94eb
                        - /providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759
                        - fffedd8f-ffff-fffd-fffd-fffed2f84852
                        - myResourceGroup2
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myResourceGroup2/providers/Microsoft.Storage/storageAccounts/mysa2
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults":
    post:
      description: Queries policy states for the resources under the resource group.
      operationId: PolicyStates_ListQueryResultsForResourceGroup
      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:
          parameters:
            api-version: 2017-08-09-preview
            policyStatesResource: latest
            resourceGroupName: myResourceGroup
            subscriptionId: fffedd8f-ffff-fffd-fffd-fffed2f84852
          responses:
            "200":
              body:
                value:
                  - columns:
                      EffectiveParameters:
                        dataType: String
                        name: EffectiveParameters
                        ordinal: 5
                      IsCompliant:
                        dataType: Boolean
                        name: IsCompliant
                        ordinal: 6
                      ManagementGroupIds:
                        dataType: String
                        name: ManagementGroupIds
                        ordinal: 24
                      PolicyAssignmentId:
                        dataType: String
                        name: PolicyAssignmentId
                        ordinal: 3
                      PolicyAssignmentName:
                        dataType: String
                        name: PolicyAssignmentName
                        ordinal: 12
                      PolicyAssignmentOwner:
                        dataType: String
                        name: PolicyAssignmentOwner
                        ordinal: 13
                      PolicyAssignmentParameters:
                        dataType: String
                        name: PolicyAssignmentParameters
                        ordinal: 14
                      PolicyAssignmentScope:
                        dataType: String
                        name: PolicyAssignmentScope
                        ordinal: 15
                      PolicyDefinitionAction:
                        dataType: String
                        name: PolicyDefinitionAction
                        ordinal: 17
                      PolicyDefinitionCategory:
                        dataType: String
                        name: PolicyDefinitionCategory
                        ordinal: 18
                      PolicyDefinitionId:
                        dataType: String
                        name: PolicyDefinitionId
                        ordinal: 4
                      PolicyDefinitionName:
                        dataType: String
                        name: PolicyDefinitionName
                        ordinal: 16
                      PolicyDefinitionReferenceId:
                        dataType: String
                        name: PolicyDefinitionReferenceId
                        ordinal: 25
                      PolicySetDefinitionCategory:
                        dataType: String
                        name: PolicySetDefinitionCategory
                        ordinal: 22
                      PolicySetDefinitionId:
                        dataType: String
                        name: PolicySetDefinitionId
                        ordinal: 19
                      PolicySetDefinitionName:
                        dataType: String
                        name: PolicySetDefinitionName
                        ordinal: 20
                      PolicySetDefinitionOwner:
                        dataType: String
                        name: PolicySetDefinitionOwner
                        ordinal: 21
                      PolicySetDefinitionParameters:
                        dataType: String
                        name: PolicySetDefinitionParameters
                        ordinal: 23
                      ResourceGroup:
                        dataType: String
                        name: ResourceGroup
                        ordinal: 10
                      ResourceId:
                        dataType: String
                        name: ResourceId
                        ordinal: 2
                      ResourceLocation:
                        dataType: String
                        name: ResourceLocation
                        ordinal: 9
                      ResourceTags:
                        dataType: String
                        name: ResourceTags
                        ordinal: 11
                      ResourceType:
                        dataType: String
                        name: ResourceType
                        ordinal: 8
                      SubscriptionId:
                        dataType: String
                        name: SubscriptionId
                        ordinal: 7
                      Timestamp:
                        dataType: DateTime
                        name: Timestamp
                        ordinal: 1
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - 2018-02-09T00:06:00Z
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName/serviceCertificates/sha1-FFFBDAF1F25210FFFDD95BD0C9B0AFCD6F26FFFF
                        - /providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c
                        - /providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d
                        - null
                        - false
                        - fffedd8f-ffff-fffd-fffd-fffed2f84852
                        - /Microsoft.ClassicCompute/domainNames/serviceCertificates
                        - eastus
                        - myResourceGroup
                        - tbd
                        - 186044306c044a1d8c0ff76c
                        - tbd
                        - '{"allowedLocations":{"value":["centralus"]}}'
                        - /providers/Microsoft.Management/managementGroups/mymg
                        - 022d9357-5a90-46f7-9554-21d30ce4c32d
                        - audit
                        - tbd
                        - null
                        - null
                        - null
                        - null
                        - null
                        - mymg,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
                      - - 2018-02-09T00:06:00Z
                        - /subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName
                        - /providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c
                        - /providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d
                        - null
                        - false
                        - fffedd8f-ffff-fffd-fffd-fffed2f84852
                        - /Microsoft.ClassicCompute/domainNames
                        - eastus
                        - myResourceGroup
                        - tbd
                        - 186044306c044a1d8c0ff76c
                        - tbd
                        - '{"allowedLocations":{"value":["centralus"]}}'
                        - /providers/Microsoft.Management/managementGroups/mymg
                        - 022d9357-5a90-46f7-9554-21d30ce4c32d
                        - audit
                        - tbd
                        - null
                        - null
                        - null
                        - null
                        - null
                        - mymg,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
  "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults":
    post:
      description: Queries policy states for the resource.
      operationId: PolicyStates_ListQueryResultsForResource
      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"
      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 nested resource scope:
          parameters:
            api-version: 2017-08-09-preview
            policyStatesResource: default
            resourceId: subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication
          responses:
            "200":
              body:
                value:
                  - columns:
                      EffectiveParameters:
                        dataType: String
                        name: EffectiveParameters
                        ordinal: 5
                      IsCompliant:
                        dataType: Boolean
                        name: IsCompliant
                        ordinal: 6
                      ManagementGroupIds:
                        dataType: String
                        name: ManagementGroupIds
                        ordinal: 24
                      PolicyAssignmentId:
                        dataType: String
                        name: PolicyAssignmentId
                        ordinal: 3
                      PolicyAssignmentName:
                        dataType: String
                        name: PolicyAssignmentName
                        ordinal: 12
                      PolicyAssignmentOwner:
                        dataType: String
                        name: PolicyAssignmentOwner
                        ordinal: 13
                      PolicyAssignmentParameters:
                        dataType: String
                        name: PolicyAssignmentParameters
                        ordinal: 14
                      PolicyAssignmentScope:
                        dataType: String
                        name: PolicyAssignmentScope
                        ordinal: 15
                      PolicyDefinitionAction:
                        dataType: String
                        name: PolicyDefinitionAction
                        ordinal: 17
                      PolicyDefinitionCategory:
                        dataType: String
                        name: PolicyDefinitionCategory
                        ordinal: 18
                      PolicyDefinitionId:
                        dataType: String
                        name: PolicyDefinitionId
                        ordinal: 4
                      PolicyDefinitionName:
                        dataType: String
                        name: PolicyDefinitionName
                        ordinal: 16
                      PolicyDefinitionReferenceId:
                        dataType: String
                        name: PolicyDefinitionReferenceId
                        ordinal: 25
                      PolicySetDefinitionCategory:
                        dataType: String
                        name: PolicySetDefinitionCategory
                        ordinal: 22
                      PolicySetDefinitionId:
                        dataType: String
                        name: PolicySetDefinitionId
                        ordinal: 19
                      PolicySetDefinitionName:
                        dataType: String
                        name: PolicySetDefinitionName
                        ordinal: 20
                      PolicySetDefinitionOwner:
                        dataType: String
                        name: PolicySetDefinitionOwner
                        ordinal: 21
                      PolicySetDefinitionParameters:
                        dataType: String
                        name: PolicySetDefinitionParameters
                        ordinal: 23
                      ResourceGroup:
                        dataType: String
                        name: ResourceGroup
                        ordinal: 10
                      ResourceId:
                        dataType: String
                        name: ResourceId
                        ordinal: 2
                      ResourceLocation:
                        dataType: String
                        name: ResourceLocation
                        ordinal: 9
                      ResourceTags:
                        dataType: String
                        name: ResourceTags
                        ordinal: 11
                      ResourceType:
                        dataType: String
                        name: ResourceType
                        ordinal: 8
                      SubscriptionId:
                        dataType: String
                        name: SubscriptionId
                        ordinal: 7
                      Timestamp:
                        dataType: DateTime
                        name: Timestamp
                        ordinal: 1
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - 2018-02-08T07:04:29Z
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/d6be6bb37e5f4333baa95c2a
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6
                        - null
                        - false
                        - fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - /Microsoft.ServiceFabric/clusters/applications
                        - eastus
                        - myResourceGroup
                        - tbd
                        - d6be6bb37e5f4333baa95c2a
                        - tbd
                        - "{}"
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - 5948d091-78b7-4d3b-a404-cc6a0329b0c6
                        - audit
                        - tbd
                        - ""
                        - ""
                        - null
                        - null
                        - null
                        - mymg,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
                      - - 2018-02-08T07:04:29Z
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1
                        - null
                        - false
                        - fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - /Microsoft.ServiceFabric/clusters/applications
                        - eastus
                        - myResourceGroup
                        - tbd
                        - 3f3c4330183b4e218fe6fd29
                        - tbd
                        - "{}"
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - 24813039-7534-408a-9842-eb99f45721b1
                        - audit
                        - tbd
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c
                        - 3e3807c1-65c9-49e0-a406-82d8ae3e338c
                        - null
                        - null
                        - null
                        - mymg,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
        Query all policy states at resource scope:
          parameters:
            api-version: 2017-08-09-preview
            policyStatesResource: default
            resourceId: subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName
          responses:
            "200":
              body:
                value:
                  - columns:
                      EffectiveParameters:
                        dataType: String
                        name: EffectiveParameters
                        ordinal: 5
                      IsCompliant:
                        dataType: Boolean
                        name: IsCompliant
                        ordinal: 6
                      ManagementGroupIds:
                        dataType: String
                        name: ManagementGroupIds
                        ordinal: 24
                      PolicyAssignmentId:
                        dataType: String
                        name: PolicyAssignmentId
                        ordinal: 3
                      PolicyAssignmentName:
                        dataType: String
                        name: PolicyAssignmentName
                        ordinal: 12
                      PolicyAssignmentOwner:
                        dataType: String
                        name: PolicyAssignmentOwner
                        ordinal: 13
                      PolicyAssignmentParameters:
                        dataType: String
                        name: PolicyAssignmentParameters
                        ordinal: 14
                      PolicyAssignmentScope:
                        dataType: String
                        name: PolicyAssignmentScope
                        ordinal: 15
                      PolicyDefinitionAction:
                        dataType: String
                        name: PolicyDefinitionAction
                        ordinal: 17
                      PolicyDefinitionCategory:
                        dataType: String
                        name: PolicyDefinitionCategory
                        ordinal: 18
                      PolicyDefinitionId:
                        dataType: String
                        name: PolicyDefinitionId
                        ordinal: 4
                      PolicyDefinitionName:
                        dataType: String
                        name: PolicyDefinitionName
                        ordinal: 16
                      PolicyDefinitionReferenceId:
                        dataType: String
                        name: PolicyDefinitionReferenceId
                        ordinal: 25
                      PolicySetDefinitionCategory:
                        dataType: String
                        name: PolicySetDefinitionCategory
                        ordinal: 22
                      PolicySetDefinitionId:
                        dataType: String
                        name: PolicySetDefinitionId
                        ordinal: 19
                      PolicySetDefinitionName:
                        dataType: String
                        name: PolicySetDefinitionName
                        ordinal: 20
                      PolicySetDefinitionOwner:
                        dataType: String
                        name: PolicySetDefinitionOwner
                        ordinal: 21
                      PolicySetDefinitionParameters:
                        dataType: String
                        name: PolicySetDefinitionParameters
                        ordinal: 23
                      ResourceGroup:
                        dataType: String
                        name: ResourceGroup
                        ordinal: 10
                      ResourceId:
                        dataType: String
                        name: ResourceId
                        ordinal: 2
                      ResourceLocation:
                        dataType: String
                        name: ResourceLocation
                        ordinal: 9
                      ResourceTags:
                        dataType: String
                        name: ResourceTags
                        ordinal: 11
                      ResourceType:
                        dataType: String
                        name: ResourceType
                        ordinal: 8
                      SubscriptionId:
                        dataType: String
                        name: SubscriptionId
                        ordinal: 7
                      Timestamp:
                        dataType: DateTime
                        name: Timestamp
                        ordinal: 1
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - 2018-02-08T07:04:29Z
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName
                        - /providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c
                        - /providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d
                        - null
                        - false
                        - fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - /Microsoft.ClassicCompute/domainNames
                        - eastus
                        - myResourceGroup
                        - tbd
                        - 186044306c044a1d8c0ff76c
                        - tbd
                        - '{"allowedLocations":{"value":["centralus"]}}'
                        - /providers/Microsoft.Management/managementGroups/mymg
                        - 022d9357-5a90-46f7-9554-21d30ce4c32d
                        - audit
                        - tbd
                        - null
                        - null
                        - null
                        - null
                        - null
                        - mymg,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
                      - - 2018-02-08T07:04:29Z
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourcegroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value
                        - null
                        - false
                        - fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - /Microsoft.ClassicCompute/domainNames
                        - eastus
                        - myResourceGroup
                        - tbd
                        - test
                        - tbd
                        - '{"tagName":{"value":"no"},"tagValue":{"value":"no"}}'
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - Audit a tag and it's value
                        - audit
                        - tbd
                        - null
                        - null
                        - null
                        - null
                        - null
                        - mymg,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
        Query all policy states at subscription level nested resource scope:
          parameters:
            api-version: 2017-08-09-preview
            policyStatesResource: default
            resourceId: subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource
          responses:
            "200":
              body:
                value:
                  - columns:
                      EffectiveParameters:
                        dataType: String
                        name: EffectiveParameters
                        ordinal: 5
                      IsCompliant:
                        dataType: Boolean
                        name: IsCompliant
                        ordinal: 6
                      ManagementGroupIds:
                        dataType: String
                        name: ManagementGroupIds
                        ordinal: 24
                      PolicyAssignmentId:
                        dataType: String
                        name: PolicyAssignmentId
                        ordinal: 3
                      PolicyAssignmentName:
                        dataType: String
                        name: PolicyAssignmentName
                        ordinal: 12
                      PolicyAssignmentOwner:
                        dataType: String
                        name: PolicyAssignmentOwner
                        ordinal: 13
                      PolicyAssignmentParameters:
                        dataType: String
                        name: PolicyAssignmentParameters
                        ordinal: 14
                      PolicyAssignmentScope:
                        dataType: String
                        name: PolicyAssignmentScope
                        ordinal: 15
                      PolicyDefinitionAction:
                        dataType: String
                        name: PolicyDefinitionAction
                        ordinal: 17
                      PolicyDefinitionCategory:
                        dataType: String
                        name: PolicyDefinitionCategory
                        ordinal: 18
                      PolicyDefinitionId:
                        dataType: String
                        name: PolicyDefinitionId
                        ordinal: 4
                      PolicyDefinitionName:
                        dataType: String
                        name: PolicyDefinitionName
                        ordinal: 16
                      PolicyDefinitionReferenceId:
                        dataType: String
                        name: PolicyDefinitionReferenceId
                        ordinal: 25
                      PolicySetDefinitionCategory:
                        dataType: String
                        name: PolicySetDefinitionCategory
                        ordinal: 22
                      PolicySetDefinitionId:
                        dataType: String
                        name: PolicySetDefinitionId
                        ordinal: 19
                      PolicySetDefinitionName:
                        dataType: String
                        name: PolicySetDefinitionName
                        ordinal: 20
                      PolicySetDefinitionOwner:
                        dataType: String
                        name: PolicySetDefinitionOwner
                        ordinal: 21
                      PolicySetDefinitionParameters:
                        dataType: String
                        name: PolicySetDefinitionParameters
                        ordinal: 23
                      ResourceGroup:
                        dataType: String
                        name: ResourceGroup
                        ordinal: 10
                      ResourceId:
                        dataType: String
                        name: ResourceId
                        ordinal: 2
                      ResourceLocation:
                        dataType: String
                        name: ResourceLocation
                        ordinal: 9
                      ResourceTags:
                        dataType: String
                        name: ResourceTags
                        ordinal: 11
                      ResourceType:
                        dataType: String
                        name: ResourceType
                        ordinal: 8
                      SubscriptionId:
                        dataType: String
                        name: SubscriptionId
                        ordinal: 7
                      Timestamp:
                        dataType: DateTime
                        name: Timestamp
                        ordinal: 1
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - 2018-02-08T07:04:29Z
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/d6be6bb37e5f4333baa95c2a
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6
                        - null
                        - false
                        - fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - /Microsoft.SomeNamespace/someResourceType/someNestedResourceType
                        - eastus
                        - ""
                        - tbd
                        - d6be6bb37e5f4333baa95c2a
                        - tbd
                        - "{}"
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - 5948d091-78b7-4d3b-a404-cc6a0329b0c6
                        - audit
                        - tbd
                        - ""
                        - ""
                        - null
                        - null
                        - null
                        - mymg,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
                      - - 2018-02-08T07:04:29Z
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/3f3c4330183b4e218fe6fd29
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/24813039-7534-408a-9842-eb99f45721b1
                        - null
                        - false
                        - fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - /Microsoft.SomeNamespace/someResourceType/someNestedResourceType
                        - eastus
                        - ""
                        - tbd
                        - 3f3c4330183b4e218fe6fd29
                        - tbd
                        - "{}"
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - 24813039-7534-408a-9842-eb99f45721b1
                        - audit
                        - tbd
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policySetDefinitions/3e3807c1-65c9-49e0-a406-82d8ae3e338c
                        - 3e3807c1-65c9-49e0-a406-82d8ae3e338c
                        - null
                        - null
                        - null
                        - mymg,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
        Query all policy states at subscription level resource scope:
          parameters:
            api-version: 2017-08-09-preview
            policyStatesResource: default
            resourceId: subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName
          responses:
            "200":
              body:
                value:
                  - columns:
                      EffectiveParameters:
                        dataType: String
                        name: EffectiveParameters
                        ordinal: 5
                      IsCompliant:
                        dataType: Boolean
                        name: IsCompliant
                        ordinal: 6
                      ManagementGroupIds:
                        dataType: String
                        name: ManagementGroupIds
                        ordinal: 24
                      PolicyAssignmentId:
                        dataType: String
                        name: PolicyAssignmentId
                        ordinal: 3
                      PolicyAssignmentName:
                        dataType: String
                        name: PolicyAssignmentName
                        ordinal: 12
                      PolicyAssignmentOwner:
                        dataType: String
                        name: PolicyAssignmentOwner
                        ordinal: 13
                      PolicyAssignmentParameters:
                        dataType: String
                        name: PolicyAssignmentParameters
                        ordinal: 14
                      PolicyAssignmentScope:
                        dataType: String
                        name: PolicyAssignmentScope
                        ordinal: 15
                      PolicyDefinitionAction:
                        dataType: String
                        name: PolicyDefinitionAction
                        ordinal: 17
                      PolicyDefinitionCategory:
                        dataType: String
                        name: PolicyDefinitionCategory
                        ordinal: 18
                      PolicyDefinitionId:
                        dataType: String
                        name: PolicyDefinitionId
                        ordinal: 4
                      PolicyDefinitionName:
                        dataType: String
                        name: PolicyDefinitionName
                        ordinal: 16
                      PolicyDefinitionReferenceId:
                        dataType: String
                        name: PolicyDefinitionReferenceId
                        ordinal: 25
                      PolicySetDefinitionCategory:
                        dataType: String
                        name: PolicySetDefinitionCategory
                        ordinal: 22
                      PolicySetDefinitionId:
                        dataType: String
                        name: PolicySetDefinitionId
                        ordinal: 19
                      PolicySetDefinitionName:
                        dataType: String
                        name: PolicySetDefinitionName
                        ordinal: 20
                      PolicySetDefinitionOwner:
                        dataType: String
                        name: PolicySetDefinitionOwner
                        ordinal: 21
                      PolicySetDefinitionParameters:
                        dataType: String
                        name: PolicySetDefinitionParameters
                        ordinal: 23
                      ResourceGroup:
                        dataType: String
                        name: ResourceGroup
                        ordinal: 10
                      ResourceId:
                        dataType: String
                        name: ResourceId
                        ordinal: 2
                      ResourceLocation:
                        dataType: String
                        name: ResourceLocation
                        ordinal: 9
                      ResourceTags:
                        dataType: String
                        name: ResourceTags
                        ordinal: 11
                      ResourceType:
                        dataType: String
                        name: ResourceType
                        ordinal: 8
                      SubscriptionId:
                        dataType: String
                        name: SubscriptionId
                        ordinal: 7
                      Timestamp:
                        dataType: DateTime
                        name: Timestamp
                        ordinal: 1
                    metadata:
                      generatedQuery: ""
                    rows:
                      - - 2018-02-08T07:04:29Z
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName
                        - /providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c
                        - /providers/Microsoft.Management/managementGroups/mymg/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d
                        - null
                        - false
                        - fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - /Microsoft.SomeNamespace/someResourceType
                        - eastus
                        - ""
                        - tbd
                        - 186044306c044a1d8c0ff76c
                        - tbd
                        - '{"allowedLocations":{"value":["centralus"]}}'
                        - /providers/Microsoft.Management/managementGroups/mymg
                        - 022d9357-5a90-46f7-9554-21d30ce4c32d
                        - audit
                        - tbd
                        - null
                        - null
                        - null
                        - null
                        - null
                        - mymg,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
                      - - 2018-02-08T07:04:29Z
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyAssignments/test
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.Authorization/policyDefinitions/Audit a tag and it's value
                        - null
                        - false
                        - fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - /Microsoft.SomeNamespace/someResourceType
                        - eastus
                        - ""
                        - tbd
                        - test
                        - tbd
                        - '{"tagName":{"value":"no"},"tagValue":{"value":"no"}}'
                        - /subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5
                        - Audit a tag and it's value
                        - audit
                        - tbd
                        - null
                        - null
                        - null
                        - null
                        - null
                        - mymg,fff988bf-fff1-ffff-fffb-fffcd011db47
                        - null
definitions:
  Column:
    description: Column definition.
    properties:
      dataType:
        description: Data type of the column.
        type: string
      name:
        description: Name of the column.
        type: string
      ordinal:
        description: Ordinal value of the column in a record.
        format: int32
        type: integer
  Operation:
    description: Operation definition.
    properties:
      display:
        description: Display metadata associated with the operation.
        properties:
          description:
            description: Operation description.
            type: string
          operation:
            description: Operation name.
            type: string
          provider:
            description: Resource provider name.
            type: string
          resource:
            description: Resource name on which the operation is performed.
            type: string
      name:
        description: Operation name.
        type: string
  OperationsListResults:
    description: List of available operations.
    properties:
      value:
        description: List of available operations.
        items:
          $ref: "#/definitions/Operation"
        type: array
  PolicyStatesQueryResults:
    description: Query results.
    properties:
      value:
        description: Query results.
        items:
          $ref: "#/definitions/PolicyStatesQueryResultsTable"
        type: array
  PolicyStatesQueryResultsTable:
    description: Query results table.
    properties:
      columns:
        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
        description: List of columns included in query results.
        properties:
          EffectiveParameters:
            $ref: "#/definitions/Column"
            description: Effective parameters for the policy assignment.
          IsCompliant:
            $ref: "#/definitions/Column"
            description: Flag which states whether the resource is compliant against the policy assignment it was evaluated against.
          ManagementGroupIds:
            $ref: "#/definitions/Column"
            description: Comma separated list of management group IDs, which represent the hierarchy of the management groups the resource is under.
          PolicyAssignmentId:
            $ref: "#/definitions/Column"
            description: Policy assignment ID.
          PolicyAssignmentName:
            $ref: "#/definitions/Column"
            description: Policy assignment name.
          PolicyAssignmentOwner:
            $ref: "#/definitions/Column"
            description: Policy assignment owner.
          PolicyAssignmentParameters:
            $ref: "#/definitions/Column"
            description: Policy assignment parameters.
          PolicyAssignmentScope:
            $ref: "#/definitions/Column"
            description: Policy assignment scope.
          PolicyDefinitionAction:
            $ref: "#/definitions/Column"
            description: Policy definition action, i.e. effect.
          PolicyDefinitionCategory:
            $ref: "#/definitions/Column"
            description: Policy definition category.
          PolicyDefinitionId:
            $ref: "#/definitions/Column"
            description: Policy definition ID.
          PolicyDefinitionName:
            $ref: "#/definitions/Column"
            description: Policy definition name.
          PolicyDefinitionReferenceId:
            $ref: "#/definitions/Column"
            description: Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.
          PolicySetDefinitionCategory:
            $ref: "#/definitions/Column"
            description: Policy set definition category, if the policy assignment is for a policy set.
          PolicySetDefinitionId:
            $ref: "#/definitions/Column"
            description: Policy set definition ID, if the policy assignment is for a policy set.
          PolicySetDefinitionName:
            $ref: "#/definitions/Column"
            description: Policy set definition name, if the policy assignment is for a policy set.
          PolicySetDefinitionOwner:
            $ref: "#/definitions/Column"
            description: Policy set definition owner, if the policy assignment is for a policy set.
          PolicySetDefinitionParameters:
            $ref: "#/definitions/Column"
            description: Policy set definition parameters, if the policy assignment is for a policy set.
          ResourceGroup:
            $ref: "#/definitions/Column"
            description: Resource group name.
          ResourceId:
            $ref: "#/definitions/Column"
            description: Resource ID.
          ResourceLocation:
            $ref: "#/definitions/Column"
            description: Resource location.
          ResourceTags:
            $ref: "#/definitions/Column"
            description: List of resource tags.
          ResourceType:
            $ref: "#/definitions/Column"
            description: Resource type.
          SubscriptionId:
            $ref: "#/definitions/Column"
            description: Subscription ID.
          Timestamp:
            $ref: "#/definitions/Column"
            description: Timestamp for the policy state record.
        type: object
      metadata:
        description: Metadata about the query results.
        properties:
          generatedQuery:
            description: Internal query generated. Used for diagnostics purposes.
            type: string
      rows:
        description: Query result rows, each representing a policy state record.
        items:
          description: Query result row.
          items:
            description: Each column of the query result row.
          type: array
        type: array
  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
          message:
            description: Description of the error.
            type: string
