swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  title: RemediationsClient
  version: 2019-07-01
  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/stable/2019-07-01/remediations.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: policyinsights-remediations
  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
  managementGroupIdParameter:
    description: Management group ID.
    in: path
    name: managementGroupId
    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
  remediationNameParameter:
    description: The name of the remediation.
    in: path
    name: remediationName
    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/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations":
    get:
      description: Gets all remediations for the management group.
      operationId: Remediations_ListForManagementGroup
      parameters:
        - $ref: "#/parameters/managementGroupsNamespaceParameter"
        - $ref: "#/parameters/managementGroupIdParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/filterParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediations.
          schema:
            $ref: "#/definitions/RemediationListResult"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        List remediations at management group scope:
          parameters:
            api-version: 2019-07-01
            managementGroupId: financeMg
            managementGroupsNamespace: Microsoft.Management
          responses:
            "200":
              body:
                value:
                  - id: /providers/Microsoft.Management/managementGroups/financeMg/providers/microsoft.policyinsights/remediations/790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    name: 790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    properties:
                      createdOn: 2018-09-13T21:51:09.075918Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 2
                        totalDeployments: 2
                      lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                      policyAssignmentId: /providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
                  - id: /providers/Microsoft.Management/managementGroups/financeMg/providers/microsoft.policyinsights/remediations/0866f0cc-6cb3-422c-9fb6-a4e3e2266da8
                    name: 0866f0cc-6cb3-422c-9fb6-a4e3e2266da8
                    properties:
                      createdOn: 2018-09-13T21:49:16.4638131Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 2
                        totalDeployments: 2
                      lastUpdatedOn: 2018-09-13T21:50:18.4647478Z
                      policyAssignmentId: /providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
              headers: {}
        List remediations at management group scope with query parameters:
          parameters:
            $filter: PolicyAssignmentId eq '/providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'
            $top: 1
            api-version: 2019-07-01
            managementGroupId: financeMg
            managementGroupsNamespace: Microsoft.Management
          responses:
            "200":
              body:
                value:
                  - id: /providers/Microsoft.Management/managementGroups/financeMg/providers/microsoft.policyinsights/remediations/790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    name: 790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    properties:
                      createdOn: 2018-09-13T21:51:09.075918Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 2
                        totalDeployments: 2
                      lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                      policyAssignmentId: /providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
              headers: {}
      x-ms-pageable:
        nextLinkName: nextLink
  "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}":
    delete:
      description: Deletes an existing remediation at management group scope.
      operationId: Remediations_DeleteAtManagementGroup
      parameters:
        - $ref: "#/parameters/managementGroupsNamespaceParameter"
        - $ref: "#/parameters/managementGroupIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The deleted remediation.
          schema:
            $ref: "#/definitions/Remediation"
        "204":
          description: The remediation did not exist.
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Delete remediation at management group scope:
          parameters:
            api-version: 2019-07-01
            managementGroupId: financeMg
            managementGroupsNamespace: Microsoft.Management
            remediationName: storageRemediation
          responses:
            "200":
              body:
                id: /providers/Microsoft.Management/managementGroups/financeMg/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.075918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 2
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /providers/Microsoft.Management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Succeeded
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
            "204":
              headers: {}
    get:
      description: Gets an existing remediation at management group scope.
      operationId: Remediations_GetAtManagementGroup
      parameters:
        - $ref: "#/parameters/managementGroupsNamespaceParameter"
        - $ref: "#/parameters/managementGroupIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediation.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Get remediation at management group scope:
          parameters:
            api-version: 2019-07-01
            managementGroupId: financeMg
            managementGroupsNamespace: Microsoft.Management
            remediationName: storageRemediation
          responses:
            "200":
              body:
                id: /providers/Microsoft.Management/managementGroups/financeMg/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.075918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 2
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /providers/Microsoft.Management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Succeeded
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
    put:
      description: Creates or updates a remediation at management group scope.
      operationId: Remediations_CreateOrUpdateAtManagementGroup
      parameters:
        - $ref: "#/parameters/managementGroupsNamespaceParameter"
        - $ref: "#/parameters/managementGroupIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
        - description: The remediation parameters.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/Remediation"
      responses:
        "200":
          description: The updated remediation.
          schema:
            $ref: "#/definitions/Remediation"
        "201":
          description: The created remediation.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Create remediation at management group scope:
          parameters:
            api-version: 2019-07-01
            managementGroupId: financeMg
            managementGroupsNamespace: Microsoft.Management
            parameters:
              properties:
                policyAssignmentId: /providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
            remediationName: storageRemediation
          responses:
            "200":
              body:
                id: /providers/microsoft.management/managementGroups/financeMg/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-12T20:58:58.7531298Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 0
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-12T20:58:58.7531298Z
                  policyAssignmentId: /providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Accepted
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
            "201":
              body:
                id: /providers/microsoft.management/managementGroups/financeMg/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-12T20:58:58.7531298Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 0
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-12T20:58:58.7531298Z
                  policyAssignmentId: /providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Accepted
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
  "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel":
    post:
      description: Cancels a remediation at management group scope.
      operationId: Remediations_CancelAtManagementGroup
      parameters:
        - $ref: "#/parameters/managementGroupsNamespaceParameter"
        - $ref: "#/parameters/managementGroupIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The remediation that was canceled.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Cancel a remediation at management group scope:
          parameters:
            api-version: 2019-07-01
            managementGroupId: financeMg
            managementGroupsNamespace: Microsoft.Management
            remediationName: myRemediation
          responses:
            "200":
              body:
                id: /providers/Microsoft.Management/managementGroups/financeMg/providers/microsoft.policyinsights/remediations/myRemediation
                name: myRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.075918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 2
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /providers/Microsoft.Management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Cancelling
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
  "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments":
    post:
      description: Gets all deployments for a remediation at management group scope.
      operationId: Remediations_ListDeploymentsAtManagementGroup
      parameters:
        - $ref: "#/parameters/managementGroupsNamespaceParameter"
        - $ref: "#/parameters/managementGroupIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediation deployments.
          schema:
            $ref: "#/definitions/RemediationDeploymentsListResult"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        List deployments for a remediation at management group scope:
          parameters:
            api-version: 2019-07-01
            managementGroupId: financeMg
            managementGroupsNamespace: Microsoft.Management
            remediationName: myRemediation
          responses:
            "200":
              body:
                value:
                  - createdOn: 2018-09-13T21:51:09.075918Z
                    deploymentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.resources/deployments/a088e8fd-8600-4126-8d74-fc7ead0e9ae4
                    lastUpdatedOn: 2018-09-13T21:52:09.8919106Z
                    remediatedResourceId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
                    resourceLocation: eastus
                    status: Succeeded
                  - createdOn: 2018-09-13T21:51:09.075918Z
                    deploymentId: /subscriptions/c1164d71-0942-499f-bc2f-b6b7b0bae493/resourcegroups/myResourceGroup2/providers/microsoft.resources/deployments/6b8898c0-18a2-449e-987a-8d4d4f634f56
                    lastUpdatedOn: 2018-09-13T21:52:09.8761679Z
                    remediatedResourceId: /subscriptions/c1164d71-0942-499f-bc2f-b6b7b0bae493/resourcegroups/myResourceGroup2/providers/microsoft.storage/storageaccounts/stor1
                    resourceLocation: westus
                    status: Succeeded
              headers: {}
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations":
    get:
      description: Gets all remediations for the subscription.
      operationId: Remediations_ListForSubscription
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/filterParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediations.
          schema:
            $ref: "#/definitions/RemediationListResult"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        List remediations at subscription scope:
          parameters:
            api-version: 2019-07-01
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.policyinsights/remediations/790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    name: 790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    properties:
                      createdOn: 2018-09-13T21:51:09.075918Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 2
                        totalDeployments: 2
                      lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                      policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
                  - id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup2/providers/microsoft.policyinsights/remediations/0866f0cc-6cb3-422c-9fb6-a4e3e2266da8
                    name: 0866f0cc-6cb3-422c-9fb6-a4e3e2266da8
                    properties:
                      createdOn: 2018-09-13T21:49:16.4638131Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 2
                        totalDeployments: 2
                      lastUpdatedOn: 2018-09-13T21:50:18.4647478Z
                      policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
              headers: {}
        List remediations at subscription scope with query parameters:
          parameters:
            $filter: PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq 'storageSkuDef'
            $top: 1
            api-version: 2019-07-01
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    name: 790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    properties:
                      createdOn: 2018-09-13T21:51:09.075918Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 2
                        totalDeployments: 2
                      lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                      policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      policyDefinitionReferenceId: storageSkuDef
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
                  - id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/rg2/providers/microsoft.policyinsights/remediations/0866f0cc-6cb3-422c-9fb6-a4e3e2266da8
                    name: 0866f0cc-6cb3-422c-9fb6-a4e3e2266da8
                    properties:
                      createdOn: 2018-09-13T21:49:16.4638131Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 2
                        totalDeployments: 2
                      lastUpdatedOn: 2018-09-13T21:50:18.4647478Z
                      policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      policyDefinitionReferenceId: storageSkuDef
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
              headers: {}
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}":
    delete:
      description: Deletes an existing remediation at subscription scope.
      operationId: Remediations_DeleteAtSubscription
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The deleted remediation.
          schema:
            $ref: "#/definitions/Remediation"
        "204":
          description: The remediation did not exist.
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Delete remediation at subscription scope:
          parameters:
            api-version: 2019-07-01
            remediationName: storageRemediation
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.075918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 2
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Succeeded
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
            "204":
              headers: {}
    get:
      description: Gets an existing remediation at subscription scope.
      operationId: Remediations_GetAtSubscription
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediation.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Get remediation at subscription scope:
          parameters:
            api-version: 2019-07-01
            remediationName: storageRemediation
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.075918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 2
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Succeeded
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
    put:
      description: Creates or updates a remediation at subscription scope.
      operationId: Remediations_CreateOrUpdateAtSubscription
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
        - description: The remediation parameters.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/Remediation"
      responses:
        "200":
          description: The updated remediation.
          schema:
            $ref: "#/definitions/Remediation"
        "201":
          description: The created remediation.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Create remediation at subscription scope:
          parameters:
            api-version: 2019-07-01
            parameters:
              properties:
                policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
            remediationName: storageRemediation
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-12T20:58:58.7531298Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 0
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-12T20:58:58.7531298Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Accepted
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
            "201":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-12T20:58:58.7531298Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 0
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-12T20:58:58.7531298Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Accepted
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
        Create remediation at subscription scope with all properties:
          parameters:
            api-version: 2019-07-01
            parameters:
              properties:
                filters:
                  locations:
                    - eastus
                    - westus
                policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                policyDefinitionReferenceId: 8c8fa9e4
                resourceDiscoveryMode: ReEvaluateCompliance
            remediationName: storageRemediation
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-12T20:58:58.7531298Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 0
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-12T20:58:58.7531298Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  policyDefinitionReferenceId: 8c8fa9e4
                  provisioningState: Accepted
                  resourceDiscoveryMode: ReEvaluateCompliance
                type: Microsoft.PolicyInsights/remediations
              headers: {}
            "201":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-12T20:58:58.7531298Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 0
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-12T20:58:58.7531298Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  policyDefinitionReferenceId: 8c8fa9e4
                  provisioningState: Accepted
                  resourceDiscoveryMode: ReEvaluateCompliance
                type: Microsoft.PolicyInsights/remediations
              headers: {}
  "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel":
    post:
      description: Cancels a remediation at subscription scope.
      operationId: Remediations_CancelAtSubscription
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The remediation that was canceled.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Cancel a remediation at subscription scope:
          parameters:
            api-version: 2019-07-01
            remediationName: myRemediation
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/myRemediation
                name: myRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.075918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 2
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Cancelling
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
  "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments":
    post:
      description: Gets all deployments for a remediation at subscription scope.
      operationId: Remediations_ListDeploymentsAtSubscription
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediation deployments.
          schema:
            $ref: "#/definitions/RemediationDeploymentsListResult"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        List deployments for a remediation at subscription scope:
          parameters:
            api-version: 2019-07-01
            remediationName: myRemediation
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                value:
                  - createdOn: 2018-09-13T21:51:09.075918Z
                    deploymentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.resources/deployments/a088e8fd-8600-4126-8d74-fc7ead0e9ae4
                    lastUpdatedOn: 2018-09-13T21:52:09.8919106Z
                    remediatedResourceId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
                    resourceLocation: eastus
                    status: Succeeded
                  - createdOn: 2018-09-13T21:51:09.075918Z
                    deploymentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup2/providers/microsoft.resources/deployments/6b8898c0-18a2-449e-987a-8d4d4f634f56
                    lastUpdatedOn: 2018-09-13T21:52:09.8761679Z
                    remediatedResourceId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup2/providers/microsoft.storage/storageaccounts/stor1
                    resourceLocation: westus
                    status: Succeeded
              headers: {}
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations":
    get:
      description: Gets all remediations for the subscription.
      operationId: Remediations_ListForResourceGroup
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/resourceGroupNameParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/filterParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediations.
          schema:
            $ref: "#/definitions/RemediationListResult"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        List remediations at resource group scope:
          parameters:
            api-version: 2019-07-01
            resourceGroupName: myResourceGroup
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.policyinsights/remediations/790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    name: 790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    properties:
                      createdOn: 2018-09-13T21:51:09.075918Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 2
                        totalDeployments: 2
                      lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                      policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
                  - id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.policyinsights/remediations/0866f0cc-6cb3-422c-9fb6-a4e3e2266da8
                    name: 0866f0cc-6cb3-422c-9fb6-a4e3e2266da8
                    properties:
                      createdOn: 2018-09-13T21:49:16.4638131Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 2
                        totalDeployments: 2
                      lastUpdatedOn: 2018-09-13T21:50:18.4647478Z
                      policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
              headers: {}
        List remediations at resource group scope with query parameters:
          parameters:
            $filter: PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'
            $top: 1
            api-version: 2019-07-01
            resourceGroupName: myResourceGroup
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.policyinsights/remediations/790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    name: 790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    properties:
                      createdOn: 2018-09-13T21:51:09.075918Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 2
                        totalDeployments: 2
                      lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                      policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
                  - id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.policyinsights/remediations/0866f0cc-6cb3-422c-9fb6-a4e3e2266da8
                    name: 0866f0cc-6cb3-422c-9fb6-a4e3e2266da8
                    properties:
                      createdOn: 2018-09-13T21:49:16.4638131Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 2
                        totalDeployments: 2
                      lastUpdatedOn: 2018-09-13T21:50:18.4647478Z
                      policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
              headers: {}
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}":
    delete:
      description: Deletes an existing remediation at resource group scope.
      operationId: Remediations_DeleteAtResourceGroup
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/resourceGroupNameParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The deleted remediation.
          schema:
            $ref: "#/definitions/Remediation"
        "204":
          description: The remediation did not exist.
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Delete remediation at resource group scope:
          parameters:
            api-version: 2019-07-01
            remediationName: storageRemediation
            resourceGroupName: myResourceGroup
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.075918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 2
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Succeeded
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
            "204":
              headers: {}
    get:
      description: Gets an existing remediation at resource group scope.
      operationId: Remediations_GetAtResourceGroup
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/resourceGroupNameParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediation.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Get remediation at resource group scope:
          parameters:
            api-version: 2019-07-01
            remediationName: storageRemediation
            resourceGroupName: myResourceGroup
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.075918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 2
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Succeeded
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
    put:
      description: Creates or updates a remediation at resource group scope.
      operationId: Remediations_CreateOrUpdateAtResourceGroup
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/resourceGroupNameParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
        - description: The remediation parameters.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/Remediation"
      responses:
        "200":
          description: The updated remediation.
          schema:
            $ref: "#/definitions/Remediation"
        "201":
          description: The created remediation.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Create remediation at resource group scope:
          parameters:
            api-version: 2019-07-01
            parameters:
              properties:
                policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
            remediationName: storageRemediation
            resourceGroupName: myResourceGroup
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-12T20:58:58.7531298Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 0
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-12T20:58:58.7531298Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Accepted
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
            "201":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-12T20:58:58.7531298Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 0
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-12T20:58:58.7531298Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Accepted
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel":
    post:
      description: Cancels a remediation at resource group scope.
      operationId: Remediations_CancelAtResourceGroup
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/resourceGroupNameParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The remediation that was canceled.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Cancel a remediation at resource group scope:
          parameters:
            api-version: 2019-07-01
            remediationName: myRemediation
            resourceGroupName: myResourceGroup
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.policyinsights/remediations/myRemediation
                name: myRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.075918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 2
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Cancelling
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments":
    post:
      description: Gets all deployments for a remediation at resource group scope.
      operationId: Remediations_ListDeploymentsAtResourceGroup
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/resourceGroupNameParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediation deployments.
          schema:
            $ref: "#/definitions/RemediationDeploymentsListResult"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        List deployments for a remediation at resource group scope:
          parameters:
            api-version: 2019-07-01
            remediationName: myRemediation
            resourceGroupName: myResourceGroup
            subscriptionId: 35ee058e-5fa0-414c-8145-3ebb8d09b6e2
          responses:
            "200":
              body:
                value:
                  - createdOn: 2018-09-13T21:51:09.075918Z
                    deploymentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.resources/deployments/a088e8fd-8600-4126-8d74-fc7ead0e9ae4
                    lastUpdatedOn: 2018-09-13T21:52:09.8919106Z
                    remediatedResourceId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
                    resourceLocation: eastus
                    status: Succeeded
                  - createdOn: 2018-09-13T21:51:09.075918Z
                    deploymentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.resources/deployments/6b8898c0-18a2-449e-987a-8d4d4f634f56
                    lastUpdatedOn: 2018-09-13T21:52:09.8761679Z
                    remediatedResourceId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/stor2
                    resourceLocation: westus
                    status: Succeeded
              headers: {}
      x-ms-pageable:
        nextLinkName: nextLink
  "/{resourceId}/providers/Microsoft.PolicyInsights/remediations":
    get:
      description: Gets all remediations for a resource.
      operationId: Remediations_ListForResource
      parameters:
        - $ref: "#/parameters/resourceIdParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/filterParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediations.
          schema:
            $ref: "#/definitions/RemediationListResult"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        List remediations at individual resource scope:
          parameters:
            api-version: 2019-07-01
            resourceId: subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1/providers/microsoft.policyinsights/remediations/790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    name: 790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    properties:
                      createdOn: 2018-09-13T21:51:09.075918Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 1
                        totalDeployments: 1
                      lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                      policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
              headers: {}
        List remediations at individual resource scope with query parameters:
          parameters:
            $filter: PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'
            $top: 1
            api-version: 2019-07-01
            resourceId: subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1/providers/microsoft.policyinsights/remediations/790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    name: 790996e6-9871-4b1f-9cd9-ec42cd6ced1e
                    properties:
                      createdOn: 2018-09-13T21:51:09.075918Z
                      deploymentStatus:
                        failedDeployments: 0
                        successfulDeployments: 1
                        totalDeployments: 1
                      lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                      policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                      provisioningState: Succeeded
                      resourceDiscoveryMode: ExistingNonCompliant
                    type: Microsoft.PolicyInsights/remediations
              headers: {}
      x-ms-pageable:
        nextLinkName: nextLink
  "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}":
    delete:
      description: Deletes an existing remediation at individual resource scope.
      operationId: Remediations_DeleteAtResource
      parameters:
        - $ref: "#/parameters/resourceIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The deleted remediation.
          schema:
            $ref: "#/definitions/Remediation"
        "204":
          description: The remediation did not exist.
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Delete remediation at individual resource scope:
          parameters:
            api-version: 2019-07-01
            remediationName: storageRemediation
            resourceId: subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.075918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 1
                    totalDeployments: 1
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Succeeded
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
            "204":
              headers: {}
    get:
      description: Gets an existing remediation at resource scope.
      operationId: Remediations_GetAtResource
      parameters:
        - $ref: "#/parameters/resourceIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediation.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Get remediation at individual resource scope:
          parameters:
            api-version: 2019-07-01
            remediationName: storageRemediation
            resourceId: subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.075918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 1
                    totalDeployments: 1
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Succeeded
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
    put:
      description: Creates or updates a remediation at resource scope.
      operationId: Remediations_CreateOrUpdateAtResource
      parameters:
        - $ref: "#/parameters/resourceIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
        - description: The remediation parameters.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/Remediation"
      responses:
        "200":
          description: The updated remediation.
          schema:
            $ref: "#/definitions/Remediation"
        "201":
          description: The created remediation.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Create remediation at individual resource scope:
          parameters:
            api-version: 2019-07-01
            parameters:
              properties:
                policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
            remediationName: storageRemediation
            resourceId: subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-12T20:58:58.7531298Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 0
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-12T20:58:58.7531298Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Accepted
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
            "201":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1/providers/microsoft.policyinsights/remediations/storageRemediation
                name: storageRemediation
                properties:
                  createdOn: 2018-09-12T20:58:58.7531298Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 0
                    totalDeployments: 2
                  lastUpdatedOn: 2018-09-12T20:58:58.7531298Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Accepted
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
  "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel":
    post:
      description: Cancel a remediation at resource scope.
      operationId: Remediations_CancelAtResource
      parameters:
        - $ref: "#/parameters/resourceIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The remediation that was canceled.
          schema:
            $ref: "#/definitions/Remediation"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Cancel a remediation at individual resource scope:
          parameters:
            api-version: 2019-07-01
            remediationName: myRemediation
            resourceId: subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
          responses:
            "200":
              body:
                id: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1/providers/microsoft.policyinsights/remediations/myRemediation
                name: myRemediation
                properties:
                  createdOn: 2018-09-13T21:51:09.085918Z
                  deploymentStatus:
                    failedDeployments: 0
                    successfulDeployments: 1
                    totalDeployments: 1
                  lastUpdatedOn: 2018-09-13T21:52:10.0011706Z
                  policyAssignmentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5
                  provisioningState: Cancelling
                  resourceDiscoveryMode: ExistingNonCompliant
                type: Microsoft.PolicyInsights/remediations
              headers: {}
  "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments":
    post:
      description: Gets all deployments for a remediation at resource scope.
      operationId: Remediations_ListDeploymentsAtResource
      parameters:
        - $ref: "#/parameters/resourceIdParameter"
        - $ref: "#/parameters/remediationNameParameter"
        - $ref: "#/parameters/topParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: The retrieved remediation deployments.
          schema:
            $ref: "#/definitions/RemediationDeploymentsListResult"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        List deployments for a remediation at individual resource scope:
          parameters:
            api-version: 2019-07-01
            remediationName: myRemediation
            resourceId: subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
          responses:
            "200":
              body:
                value:
                  - createdOn: 2018-09-13T21:51:09.075918Z
                    deploymentId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.resources/deployments/a088e8fd-8600-4126-8d74-fc7ead0e9ae4
                    lastUpdatedOn: 2018-09-13T21:52:09.8919106Z
                    remediatedResourceId: /subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1
                    resourceLocation: eastus
                    status: Succeeded
              headers: {}
      x-ms-pageable:
        nextLinkName: nextLink
definitions:
  ErrorDefinition:
    description: Error definition.
    properties:
      additionalInfo:
        description: Additional scenario specific error details.
        items:
          $ref: "#/definitions/TypedErrorInfo"
        readOnly: true
        type: array
      code:
        description: Service specific error code which serves as the substatus for the HTTP error code.
        readOnly: true
        type: string
      details:
        description: Internal error details.
        items:
          $ref: "#/definitions/ErrorDefinition"
        readOnly: true
        type: array
      message:
        description: Description of the error.
        readOnly: true
        type: string
      target:
        description: The target of the error.
        readOnly: true
        type: string
  ErrorResponse:
    description: Error response.
    properties:
      error:
        $ref: "#/definitions/ErrorDefinition"
        description: The error details.
  Remediation:
    description: The remediation definition.
    properties:
      id:
        description: The ID of the remediation.
        readOnly: true
        type: string
      name:
        description: The name of the remediation.
        readOnly: true
        type: string
      properties:
        $ref: "#/definitions/RemediationProperties"
        description: Properties for the remediation.
        x-ms-client-flatten: true
      type:
        description: The type of the remediation.
        readOnly: true
        type: string
    x-ms-azure-resource: true
  RemediationDeployment:
    description: Details of a single deployment created by the remediation.
    properties:
      createdOn:
        description: The time at which the remediation was created.
        format: date-time
        readOnly: true
        type: string
      deploymentId:
        description: Resource ID of the template deployment that will remediate the resource.
        readOnly: true
        type: string
      error:
        $ref: "#/definitions/ErrorDefinition"
        description: Error encountered while remediated the resource.
        readOnly: true
      lastUpdatedOn:
        description: The time at which the remediation deployment was last updated.
        format: date-time
        readOnly: true
        type: string
      remediatedResourceId:
        description: Resource ID of the resource that is being remediated by the deployment.
        readOnly: true
        type: string
      resourceLocation:
        description: Location of the resource that is being remediated.
        readOnly: true
        type: string
      status:
        description: Status of the remediation deployment.
        readOnly: true
        type: string
  RemediationDeploymentSummary:
    description: The deployment status summary for all deployments created by the remediation.
    properties:
      failedDeployments:
        description: The number of deployments required by the remediation that have failed.
        readOnly: true
        type: integer
      successfulDeployments:
        description: The number of deployments required by the remediation that have succeeded.
        readOnly: true
        type: integer
      totalDeployments:
        description: The number of deployments required by the remediation.
        readOnly: true
        type: integer
  RemediationDeploymentsListResult:
    description: List of deployments for a remediation.
    properties:
      nextLink:
        description: The URL to get the next set of results.
        readOnly: true
        type: string
      value:
        description: Array of deployments for the remediation.
        items:
          $ref: "#/definitions/RemediationDeployment"
        readOnly: true
        type: array
  RemediationFilters:
    description: The filters that will be applied to determine which resources to remediate.
    properties:
      locations:
        description: The resource locations that will be remediated.
        items:
          type: string
        type: array
  RemediationListResult:
    description: List of remediations.
    properties:
      nextLink:
        description: The URL to get the next set of results.
        readOnly: true
        type: string
      value:
        description: Array of remediation definitions.
        items:
          $ref: "#/definitions/Remediation"
        readOnly: true
        type: array
  RemediationProperties:
    description: The remediation properties.
    properties:
      createdOn:
        description: The time at which the remediation was created.
        format: date-time
        readOnly: true
        type: string
      deploymentStatus:
        $ref: "#/definitions/RemediationDeploymentSummary"
        description: The deployment status summary for all deployments created by the remediation.
        readOnly: true
      filters:
        $ref: "#/definitions/RemediationFilters"
        description: The filters that will be applied to determine which resources to remediate.
      lastUpdatedOn:
        description: The time at which the remediation was last updated.
        format: date-time
        readOnly: true
        type: string
      policyAssignmentId:
        description: The resource ID of the policy assignment that should be remediated.
        type: string
      policyDefinitionReferenceId:
        description: The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
        type: string
      provisioningState:
        description: The status of the remediation.
        readOnly: true
        type: string
      resourceDiscoveryMode:
        description: The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
        enum:
          - ExistingNonCompliant
          - ReEvaluateCompliance
        type: string
        x-ms-enum:
          modelAsString: true
          name: ResourceDiscoveryMode
          values:
            - description: Remediate resources that are already known to be non-compliant.
              value: ExistingNonCompliant
            - description: Re-evaluate the compliance state of resources and then remediate the resources found to be non-compliant.
              value: ReEvaluateCompliance
  TypedErrorInfo:
    description: Scenario specific error details.
    properties:
      info:
        description: The scenario specific error details.
        readOnly: true
      type:
        description: The type of included error details.
        readOnly: true
        type: string
