diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json new file mode 100644 index 000000000000..64f1402bffe5 --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "resourceGroupName": "myResourceGroup", + "api-version": "2019-10-01" + }, + "responses": { + "200": {}, + "202": {} + } +} diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json new file mode 100644 index 000000000000..280413ee75cd --- /dev/null +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "api-version": "2019-10-01" + }, + "responses": { + "200": {}, + "202": {} + } +} diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/policyStates.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/policyStates.json index ab104e5d24e9..a914774d9a63 100644 --- a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/policyStates.json +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/policyStates.json @@ -495,6 +495,83 @@ } } }, + "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation": { + "post": { + "operationId": "PolicyStates_TriggerSubscriptionEvaluation", + "description": "Triggers a policy evaluation scan for all the resources under the subscription", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The scan is done." + }, + "202": { + "description": "The scan was successfully triggered." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Trigger evaluations for all resources in a subscription": { + "$ref": "./examples/PolicyStates_TriggerSubscriptionEvaluation.json" + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation": { + "post": { + "operationId": "PolicyStates_TriggerResourceGroupEvaluation", + "description": "Triggers a policy evaluation scan for all the resources under the resource group.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The scan is done." + }, + "202": { + "description": "The scan was successfully triggered." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/QueryFailure" + } + } + }, + "x-ms-examples": { + "Trigger evaluations for all resources in a resource group": { + "$ref": "./examples/PolicyStates_TriggerResourceGroupEvaluation.json" + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + } + } + }, "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults": { "post": { "operationId": "PolicyStates_ListQueryResultsForPolicySetDefinition",