swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  title: PolicyTrackedResourcesClient
  version: 2018-07-01-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/2018-07-01-preview/policyTrackedResources.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: policyinsights-policyTrackedResources
  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: Client Api Version.
    in: query
    name: api-version
    required: true
    type: string
    x-ms-parameter-location: client
  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
  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 RP; only "Microsoft.Management" is allowed.
    enum:
      - Microsoft.Management
    in: path
    name: managementGroupsNamespace
    required: true
    type: string
    x-ms-parameter-location: method
  policyTrackedResourcesResourceParameter:
    description: The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed.
    enum:
      - default
    in: path
    name: policyTrackedResourcesResource
    required: true
    type: string
    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
  subscriptionIdParameter:
    description: Microsoft Azure subscription ID.
    in: path
    name: subscriptionId
    required: true
    type: string
  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/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults":
    post:
      description: Queries policy tracked resources under the management group.
      operationId: PolicyTrackedResources_ListQueryResultsForManagementGroup
      parameters:
        - $ref: "#/parameters/managementGroupsNamespaceParameter"
        - $ref: "#/parameters/managementGroupNameParameter"
        - $ref: "#/parameters/policyTrackedResourcesResourceParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/filterParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: Query results.
          schema:
            $ref: "#/definitions/PolicyTrackedResourcesQueryResults"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/QueryFailure"
      x-ms-examples:
        Query at management group scope:
          parameters:
            api-version: 2018-07-01-preview
            managementGroupName: myManagementGroup
            managementGroupsNamespace: Microsoft.Management
            policyTrackedResourcesResource: default
          responses:
            "200":
              body:
                value:
                  - createdBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-03-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/createdByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/createdByPolicyDefinition
                    lastModifiedBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-04-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/lastModifiedByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/lastModifiedByPolicyDefinition
                    lastUpdateUtc: 2018-08-09T20:40:17.3585243Z
                    policyDetails:
                      policyAssignmentDisplayName: My Policy Assignment 1 Display name
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment1
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition1
                      policyDefinitionReferenceId: 123ABC
                      policySetDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policySetDefinitions/mySetDefinition
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName1
                  - lastUpdateUtc: 2018-08-10T00:40:17.3585243Z
                    policyDetails:
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment2
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition2
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName2
        Query at management group scope using query parameters:
          parameters:
            $filter: PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName'
            $top: 1
            api-version: 2018-07-01-preview
            managementGroupName: myManagementGroup
            managementGroupsNamespace: Microsoft.Management
            policyTrackedResourcesResource: default
          responses:
            "200":
              body:
                value:
                  - createdBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-03-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/createdByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/createdByPolicyDefinition
                    lastModifiedBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-04-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/lastModifiedByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/lastModifiedByPolicyDefinition
                    lastUpdateUtc: 2018-08-09T20:40:17.3585243Z
                    policyDetails:
                      policyAssignmentDisplayName: My Policy Assignment Display name
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition
                      policyDefinitionReferenceId: 123ABC
                      policySetDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policySetDefinitions/mySetDefinition
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults":
    post:
      description: Queries policy tracked resources under the subscription.
      operationId: PolicyTrackedResources_ListQueryResultsForSubscription
      parameters:
        - $ref: "#/parameters/policyTrackedResourcesResourceParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/filterParameter"
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: Query results.
          schema:
            $ref: "#/definitions/PolicyTrackedResourcesQueryResults"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/QueryFailure"
      x-ms-examples:
        Query at subscription scope:
          parameters:
            api-version: 2018-07-01-preview
            policyTrackedResourcesResource: default
            subscriptionId: fffedd8f-ffff-fffd-fffd-fffed2f84852
          responses:
            "200":
              body:
                value:
                  - createdBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-03-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/createdByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/createdByPolicyDefinition
                    lastModifiedBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-04-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/lastModifiedByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/lastModifiedByPolicyDefinition
                    lastUpdateUtc: 2018-08-09T20:40:17.3585243Z
                    policyDetails:
                      policyAssignmentDisplayName: My Policy Assignment 1 Display name
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment1
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition1
                      policyDefinitionReferenceId: 123ABC
                      policySetDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policySetDefinitions/mySetDefinition
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName1
                  - lastUpdateUtc: 2018-08-10T00:40:17.3585243Z
                    policyDetails:
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment2
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition2
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName2
        Query at subscription scope using query parameters:
          parameters:
            $filter: PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName'
            $top: 1
            api-version: 2018-07-01-preview
            policyTrackedResourcesResource: default
            subscriptionId: fffedd8f-ffff-fffd-fffd-fffed2f84852
          responses:
            "200":
              body:
                value:
                  - createdBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-03-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/createdByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/createdByPolicyDefinition
                    lastModifiedBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-04-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/lastModifiedByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/lastModifiedByPolicyDefinition
                    lastUpdateUtc: 2018-08-09T20:40:17.3585243Z
                    policyDetails:
                      policyAssignmentDisplayName: My Policy Assignment Display name
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition
                      policyDefinitionReferenceId: 123ABC
                      policySetDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policySetDefinitions/mySetDefinition
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults":
    post:
      description: Queries policy tracked resources under the resource group.
      operationId: PolicyTrackedResources_ListQueryResultsForResourceGroup
      parameters:
        - $ref: "#/parameters/resourceGroupNameParameter"
        - $ref: "#/parameters/policyTrackedResourcesResourceParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/filterParameter"
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: Query results.
          schema:
            $ref: "#/definitions/PolicyTrackedResourcesQueryResults"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/QueryFailure"
      x-ms-examples:
        Query at resource group scope:
          parameters:
            api-version: 2018-07-01-preview
            policyTrackedResourcesResource: default
            resourceGroupName: myResourceGroup
            subscriptionId: fffedd8f-ffff-fffd-fffd-fffed2f84852
          responses:
            "200":
              body:
                value:
                  - createdBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-03-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/createdByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/createdByPolicyDefinition
                    lastModifiedBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-04-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/lastModifiedByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/lastModifiedByPolicyDefinition
                    lastUpdateUtc: 2018-08-09T20:40:17.3585243Z
                    policyDetails:
                      policyAssignmentDisplayName: My Policy Assignment 1 Display name
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment1
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition1
                      policyDefinitionReferenceId: 123ABC
                      policySetDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policySetDefinitions/mySetDefinition
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName1
                  - lastUpdateUtc: 2018-08-10T00:40:17.3585243Z
                    policyDetails:
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment2
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition2
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName2
        Query at resource group scope using query parameters:
          parameters:
            $filter: PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource1'
            $top: 1
            api-version: 2018-07-01-preview
            policyTrackedResourcesResource: default
            resourceGroupName: myResourceGroup
            subscriptionId: fffedd8f-ffff-fffd-fffd-fffed2f84852
          responses:
            "200":
              body:
                value:
                  - createdBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-03-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/createdByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/createdByPolicyDefinition
                    lastModifiedBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-04-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/lastModifiedByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/lastModifiedByPolicyDefinition
                    lastUpdateUtc: 2018-08-09T20:40:17.3585243Z
                    policyDetails:
                      policyAssignmentDisplayName: My Policy Assignment 1 Display name
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment1
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition1
                      policyDefinitionReferenceId: 123ABC
                      policySetDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policySetDefinitions/mySetDefinition
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource1
      x-ms-pageable:
        nextLinkName: nextLink
  "/{resourceId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults":
    post:
      description: Queries policy tracked resources under the resource.
      operationId: PolicyTrackedResources_ListQueryResultsForResource
      parameters:
        - $ref: "#/parameters/resourceIdParameter"
        - $ref: "#/parameters/policyTrackedResourcesResourceParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/filterParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: Query results.
          schema:
            $ref: "#/definitions/PolicyTrackedResourcesQueryResults"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/QueryFailure"
      x-ms-examples:
        Query at resource scope:
          parameters:
            api-version: 2018-07-01-preview
            policyTrackedResourcesResource: default
            resourceId: subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource
          responses:
            "200":
              body:
                value:
                  - createdBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-03-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/createdByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/createdByPolicyDefinition
                    lastModifiedBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-04-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/lastModifiedByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/lastModifiedByPolicyDefinition
                    lastUpdateUtc: 2018-08-09T20:40:17.3585243Z
                    policyDetails:
                      policyAssignmentDisplayName: My Policy Assignment 1 Display name
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment1
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition1
                      policyDefinitionReferenceId: 123ABC
                      policySetDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policySetDefinitions/mySetDefinition
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource1
                  - lastUpdateUtc: 2018-08-10T00:40:17.3585243Z
                    policyDetails:
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment2
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition2
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource2
        Query at resource scope using query parameters:
          parameters:
            $filter: PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource1'
            $top: 1
            api-version: 2018-07-01-preview
            policyTrackedResourcesResource: default
            resourceId: subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource
          responses:
            "200":
              body:
                value:
                  - createdBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-03-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/createdByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/createdByPolicyDefinition
                    lastModifiedBy:
                      deploymentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deployments/deploymentName
                      deploymentTime: 2018-04-09T00:00:00.0000000Z
                      policyDetails:
                        policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/lastModifiedByPolicyAssignment
                        policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/
                        policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/lastModifiedByPolicyDefinition
                    lastUpdateUtc: 2018-08-09T20:40:17.3585243Z
                    policyDetails:
                      policyAssignmentDisplayName: My Policy Assignment 1 Display name
                      policyAssignmentId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment1
                      policyAssignmentScope: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/
                      policyDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyDefinitions/myPolicyDefinition1
                      policyDefinitionReferenceId: 123ABC
                      policySetDefinitionId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/providers/Microsoft.Authorization/policySetDefinitions/mySetDefinition
                    trackedResourceId: /subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource1
      x-ms-pageable:
        nextLinkName: nextLink
definitions:
  PolicyDetails:
    description: The policy details.
    properties:
      policyAssignmentDisplayName:
        description: The display name of the policy assignment.
        readOnly: true
        type: string
      policyAssignmentId:
        description: The ID of the policy assignment.
        readOnly: true
        type: string
      policyAssignmentScope:
        description: The scope of the policy assignment.
        readOnly: true
        type: string
      policyDefinitionId:
        description: The ID of the policy definition.
        readOnly: true
        type: string
      policyDefinitionReferenceId:
        description: The policy definition reference ID within the policy set definition.
        readOnly: true
        type: string
      policySetDefinitionId:
        description: The ID of the policy set definition.
        readOnly: true
        type: string
    type: object
  PolicyTrackedResource:
    description: Policy tracked resource record.
    properties:
      createdBy:
        $ref: "#/definitions/TrackedResourceModificationDetails"
        description: The details of the policy triggered deployment that created the tracked resource.
        readOnly: true
      lastModifiedBy:
        $ref: "#/definitions/TrackedResourceModificationDetails"
        description: The details of the policy triggered deployment that modified the tracked resource.
        readOnly: true
      lastUpdateUtc:
        description: Timestamp of the last update to the tracked resource.
        format: date-time
        readOnly: true
        type: string
      policyDetails:
        $ref: "#/definitions/PolicyDetails"
        description: The details of the policy that require the tracked resource.
        readOnly: true
      trackedResourceId:
        description: The ID of the policy tracked resource.
        readOnly: true
        type: string
    type: object
  PolicyTrackedResourcesQueryResults:
    description: Query results.
    properties:
      nextLink:
        description: The URL to get the next set of results.
        readOnly: true
        type: string
      value:
        description: Query results.
        items:
          $ref: "#/definitions/PolicyTrackedResource"
        readOnly: true
        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.
            readOnly: true
            type: string
          message:
            description: Description of the error.
            readOnly: true
            type: string
  TrackedResourceModificationDetails:
    description: The details of the policy triggered deployment that created or modified the tracked resource.
    properties:
      deploymentId:
        description: The ID of the deployment that created or modified the tracked resource.
        readOnly: true
        type: string
      deploymentTime:
        description: Timestamp of the deployment that created or modified the tracked resource.
        format: date-time
        readOnly: true
        type: string
      policyDetails:
        $ref: "#/definitions/PolicyDetails"
        description: The details of the policy that created or modified the tracked resource.
        readOnly: true
    type: object
