在订阅范围内创建或更新修正。
PUT https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}?api-version=2021-10-01
URI 参数
名称 |
在 |
必需 |
类型 |
说明 |
remediationName
|
path |
True
|
string
|
修正的名称。
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure 订阅 ID。
|
api-version
|
query |
True
|
string
|
客户端 API 版本。
|
请求正文
名称 |
类型 |
说明 |
properties.failureThreshold
|
FailureThreshold
|
修正失败阈值设置
|
properties.filters
|
RemediationFilters
|
将应用于确定要修正的资源的筛选器。
|
properties.parallelDeployments
|
integer
|
确定在任何给定时间要修正的资源数。 可用于增加或减少修正的速度。 如果未提供,则使用默认的并行部署值。
|
properties.policyAssignmentId
|
string
|
应修正的策略分配的资源 ID。
|
properties.policyDefinitionReferenceId
|
string
|
应修正的单个定义的策略定义引用 ID。 当正在修正的策略分配分配策略集定义时是必需的。
|
properties.resourceCount
|
integer
|
确定修正作业可以修正的最大资源数。 如果未提供,则使用默认资源计数。
|
properties.resourceDiscoveryMode
|
ResourceDiscoveryMode
|
发现要修正的资源的方式。 如果未指定,则默认为 ExistingNonCompliant。
|
响应
安全性
azure_auth
Azure Active Directory OAuth2 流
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 |
说明 |
user_impersonation
|
模拟用户帐户
|
示例
Sample Request
PUT https://management.azure.com/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/Microsoft.PolicyInsights/remediations/storageRemediation?api-version=2021-10-01
{
"properties": {
"policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"
}
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.policyinsights.fluent.models.RemediationInner;
/** Samples for Remediations CreateOrUpdateAtSubscription. */
public final class Main {
/*
* x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json
*/
/**
* Sample code: Create remediation at subscription scope.
*
* @param manager Entry point to PolicyInsightsManager.
*/
public static void createRemediationAtSubscriptionScope(
com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) {
manager
.remediations()
.createOrUpdateAtSubscriptionWithResponse(
"storageRemediation",
new RemediationInner()
.withPolicyAssignmentId(
"/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.policyinsights import PolicyInsightsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-policyinsights
# USAGE
python remediations_create_subscription_scope.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PolicyInsightsClient(
credential=DefaultAzureCredential(),
subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2",
)
response = client.remediations.create_or_update_at_subscription(
remediation_name="storageRemediation",
parameters={
"properties": {
"policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"
}
},
)
print(response)
# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpolicyinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/policyinsights/armpolicyinsights"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/05a9cdab363b8ec824094ee73950c04594325172/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json
func ExampleRemediationsClient_CreateOrUpdateAtSubscription_createRemediationAtSubscriptionScope() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpolicyinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewRemediationsClient().CreateOrUpdateAtSubscription(ctx, "storageRemediation", armpolicyinsights.Remediation{
Properties: &armpolicyinsights.RemediationProperties{
PolicyAssignmentID: to.Ptr("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Remediation = armpolicyinsights.Remediation{
// Name: to.Ptr("storageRemediation"),
// Type: to.Ptr("Microsoft.PolicyInsights/remediations"),
// ID: to.Ptr("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation"),
// Properties: &armpolicyinsights.RemediationProperties{
// CorrelationID: to.Ptr("a14e1d60-dae9-4771-b4be-a556d69e77a6"),
// CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-12T20:58:58.753Z"); return t}()),
// DeploymentStatus: &armpolicyinsights.RemediationDeploymentSummary{
// FailedDeployments: to.Ptr[int32](0),
// SuccessfulDeployments: to.Ptr[int32](0),
// TotalDeployments: to.Ptr[int32](2),
// },
// LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-12T20:58:58.753Z"); return t}()),
// PolicyAssignmentID: to.Ptr("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"),
// ProvisioningState: to.Ptr("Succeeded"),
// ResourceDiscoveryMode: to.Ptr(armpolicyinsights.ResourceDiscoveryModeExistingNonCompliant),
// StatusMessage: to.Ptr("Remediation extended status"),
// },
// SystemData: &armpolicyinsights.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-12T20:58:58.753Z"); return t}()),
// CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef6"),
// CreatedByType: to.Ptr(armpolicyinsights.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-12T20:58:58.753Z"); return t}()),
// LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef6"),
// LastModifiedByType: to.Ptr(armpolicyinsights.CreatedByTypeUser),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PolicyInsightsClient } = require("@azure/arm-policyinsights");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a remediation at subscription scope.
*
* @summary Creates or updates a remediation at subscription scope.
* x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json
*/
async function createRemediationAtSubscriptionScope() {
const subscriptionId =
process.env["POLICYINSIGHTS_SUBSCRIPTION_ID"] || "35ee058e-5fa0-414c-8145-3ebb8d09b6e2";
const remediationName = "storageRemediation";
const parameters = {
policyAssignmentId:
"/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
};
const credential = new DefaultAzureCredential();
const client = new PolicyInsightsClient(credential, subscriptionId);
const result = await client.remediations.createOrUpdateAtSubscription(
remediationName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"properties": {
"policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
"provisioningState": "Accepted",
"createdOn": "2018-09-12T20:58:58.7531298Z",
"lastUpdatedOn": "2018-09-12T20:58:58.7531298Z",
"resourceDiscoveryMode": "ExistingNonCompliant",
"deploymentStatus": {
"totalDeployments": 2,
"successfulDeployments": 0,
"failedDeployments": 0
},
"statusMessage": "Remediation extended status",
"correlationId": "a14e1d60-dae9-4771-b4be-a556d69e77a6"
},
"id": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation",
"name": "storageRemediation",
"type": "Microsoft.PolicyInsights/remediations",
"systemData": {
"createdBy": "b69a9388-9488-4534-b470-7ec6d41beef6",
"createdByType": "User",
"createdAt": "2018-09-12T20:58:58.7531298Z",
"lastModifiedBy": "b69a9388-9488-4534-b470-7ec6d41beef6",
"lastModifiedByType": "User",
"lastModifiedAt": "2018-09-12T20:58:58.7531298Z"
}
}
{
"properties": {
"policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
"provisioningState": "Accepted",
"createdOn": "2018-09-12T20:58:58.7531298Z",
"lastUpdatedOn": "2018-09-12T20:58:58.7531298Z",
"resourceDiscoveryMode": "ExistingNonCompliant",
"deploymentStatus": {
"totalDeployments": 2,
"successfulDeployments": 0,
"failedDeployments": 0
},
"statusMessage": "Remediation extended status",
"correlationId": "a14e1d60-dae9-4771-b4be-a556d69e77a6"
},
"id": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation",
"name": "storageRemediation",
"type": "Microsoft.PolicyInsights/remediations",
"systemData": {
"createdBy": "b69a9388-9488-4534-b470-7ec6d41beef6",
"createdByType": "User",
"createdAt": "2018-09-12T20:58:58.7531298Z",
"lastModifiedBy": "b69a9388-9488-4534-b470-7ec6d41beef6",
"lastModifiedByType": "User",
"lastModifiedAt": "2018-09-12T20:58:58.7531298Z"
}
}
Sample Request
PUT https://management.azure.com/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/Microsoft.PolicyInsights/remediations/storageRemediation?api-version=2021-10-01
{
"properties": {
"policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
"policyDefinitionReferenceId": "8c8fa9e4",
"resourceDiscoveryMode": "ReEvaluateCompliance",
"filters": {
"locations": [
"eastus",
"westus"
]
},
"resourceCount": 42,
"parallelDeployments": 6,
"failureThreshold": {
"percentage": 0.1
}
}
}
import com.azure.core.util.Context;
import com.azure.resourcemanager.policyinsights.fluent.models.RemediationInner;
import com.azure.resourcemanager.policyinsights.models.RemediationFilters;
import com.azure.resourcemanager.policyinsights.models.RemediationPropertiesFailureThreshold;
import com.azure.resourcemanager.policyinsights.models.ResourceDiscoveryMode;
import java.util.Arrays;
/** Samples for Remediations CreateOrUpdateAtSubscription. */
public final class Main {
/*
* x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope_AllProperties.json
*/
/**
* Sample code: Create remediation at subscription scope with all properties.
*
* @param manager Entry point to PolicyInsightsManager.
*/
public static void createRemediationAtSubscriptionScopeWithAllProperties(
com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) {
manager
.remediations()
.createOrUpdateAtSubscriptionWithResponse(
"storageRemediation",
new RemediationInner()
.withPolicyAssignmentId(
"/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5")
.withPolicyDefinitionReferenceId("8c8fa9e4")
.withResourceDiscoveryMode(ResourceDiscoveryMode.RE_EVALUATE_COMPLIANCE)
.withFilters(new RemediationFilters().withLocations(Arrays.asList("eastus", "westus")))
.withResourceCount(42)
.withParallelDeployments(6)
.withFailureThreshold(new RemediationPropertiesFailureThreshold().withPercentage(0.1F)),
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.policyinsights import PolicyInsightsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-policyinsights
# USAGE
python remediations_create_subscription_scope_all_properties.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PolicyInsightsClient(
credential=DefaultAzureCredential(),
subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2",
)
response = client.remediations.create_or_update_at_subscription(
remediation_name="storageRemediation",
parameters={
"properties": {
"failureThreshold": {"percentage": 0.1},
"filters": {"locations": ["eastus", "westus"]},
"parallelDeployments": 6,
"policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
"policyDefinitionReferenceId": "8c8fa9e4",
"resourceCount": 42,
"resourceDiscoveryMode": "ReEvaluateCompliance",
}
},
)
print(response)
# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope_AllProperties.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpolicyinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/policyinsights/armpolicyinsights"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/05a9cdab363b8ec824094ee73950c04594325172/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope_AllProperties.json
func ExampleRemediationsClient_CreateOrUpdateAtSubscription_createRemediationAtSubscriptionScopeWithAllProperties() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpolicyinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewRemediationsClient().CreateOrUpdateAtSubscription(ctx, "storageRemediation", armpolicyinsights.Remediation{
Properties: &armpolicyinsights.RemediationProperties{
FailureThreshold: &armpolicyinsights.RemediationPropertiesFailureThreshold{
Percentage: to.Ptr[float32](0.1),
},
Filters: &armpolicyinsights.RemediationFilters{
Locations: []*string{
to.Ptr("eastus"),
to.Ptr("westus")},
},
ParallelDeployments: to.Ptr[int32](6),
PolicyAssignmentID: to.Ptr("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"),
PolicyDefinitionReferenceID: to.Ptr("8c8fa9e4"),
ResourceCount: to.Ptr[int32](42),
ResourceDiscoveryMode: to.Ptr(armpolicyinsights.ResourceDiscoveryModeReEvaluateCompliance),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Remediation = armpolicyinsights.Remediation{
// Name: to.Ptr("storageRemediation"),
// Type: to.Ptr("Microsoft.PolicyInsights/remediations"),
// ID: to.Ptr("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation"),
// Properties: &armpolicyinsights.RemediationProperties{
// CorrelationID: to.Ptr("a14e1d60-dae9-4771-b4be-a556d69e77a6"),
// CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-12T20:58:58.753Z"); return t}()),
// DeploymentStatus: &armpolicyinsights.RemediationDeploymentSummary{
// FailedDeployments: to.Ptr[int32](0),
// SuccessfulDeployments: to.Ptr[int32](0),
// TotalDeployments: to.Ptr[int32](2),
// },
// FailureThreshold: &armpolicyinsights.RemediationPropertiesFailureThreshold{
// Percentage: to.Ptr[float32](0.1),
// },
// LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-12T20:58:58.753Z"); return t}()),
// ParallelDeployments: to.Ptr[int32](6),
// PolicyAssignmentID: to.Ptr("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"),
// PolicyDefinitionReferenceID: to.Ptr("8c8fa9e4"),
// ProvisioningState: to.Ptr("Succeeded"),
// ResourceCount: to.Ptr[int32](42),
// ResourceDiscoveryMode: to.Ptr(armpolicyinsights.ResourceDiscoveryModeReEvaluateCompliance),
// StatusMessage: to.Ptr("Remediation extended status"),
// },
// SystemData: &armpolicyinsights.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-12T20:58:58.753Z"); return t}()),
// CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef6"),
// CreatedByType: to.Ptr(armpolicyinsights.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-12T20:58:58.753Z"); return t}()),
// LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef6"),
// LastModifiedByType: to.Ptr(armpolicyinsights.CreatedByTypeUser),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PolicyInsightsClient } = require("@azure/arm-policyinsights");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a remediation at subscription scope.
*
* @summary Creates or updates a remediation at subscription scope.
* x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope_AllProperties.json
*/
async function createRemediationAtSubscriptionScopeWithAllProperties() {
const subscriptionId =
process.env["POLICYINSIGHTS_SUBSCRIPTION_ID"] || "35ee058e-5fa0-414c-8145-3ebb8d09b6e2";
const remediationName = "storageRemediation";
const parameters = {
failureThreshold: { percentage: 0.1 },
filters: { locations: ["eastus", "westus"] },
parallelDeployments: 6,
policyAssignmentId:
"/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
policyDefinitionReferenceId: "8c8fa9e4",
resourceCount: 42,
resourceDiscoveryMode: "ReEvaluateCompliance",
};
const credential = new DefaultAzureCredential();
const client = new PolicyInsightsClient(credential, subscriptionId);
const result = await client.remediations.createOrUpdateAtSubscription(
remediationName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"properties": {
"policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
"policyDefinitionReferenceId": "8c8fa9e4",
"resourceDiscoveryMode": "ReEvaluateCompliance",
"provisioningState": "Accepted",
"createdOn": "2018-09-12T20:58:58.7531298Z",
"lastUpdatedOn": "2018-09-12T20:58:58.7531298Z",
"deploymentStatus": {
"totalDeployments": 2,
"successfulDeployments": 0,
"failedDeployments": 0
},
"statusMessage": "Remediation extended status",
"correlationId": "a14e1d60-dae9-4771-b4be-a556d69e77a6",
"resourceCount": 42,
"parallelDeployments": 6,
"failureThreshold": {
"percentage": 0.1
}
},
"id": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation",
"name": "storageRemediation",
"type": "Microsoft.PolicyInsights/remediations",
"systemData": {
"createdBy": "b69a9388-9488-4534-b470-7ec6d41beef6",
"createdByType": "User",
"createdAt": "2018-09-12T20:58:58.7531298Z",
"lastModifiedBy": "b69a9388-9488-4534-b470-7ec6d41beef6",
"lastModifiedByType": "User",
"lastModifiedAt": "2018-09-12T20:58:58.7531298Z"
}
}
{
"properties": {
"policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
"policyDefinitionReferenceId": "8c8fa9e4",
"resourceDiscoveryMode": "ReEvaluateCompliance",
"provisioningState": "Accepted",
"createdOn": "2018-09-12T20:58:58.7531298Z",
"lastUpdatedOn": "2018-09-12T20:58:58.7531298Z",
"deploymentStatus": {
"totalDeployments": 2,
"successfulDeployments": 0,
"failedDeployments": 0
},
"statusMessage": "Remediation extended status",
"correlationId": "a14e1d60-dae9-4771-b4be-a556d69e77a6",
"resourceCount": 42,
"parallelDeployments": 6,
"failureThreshold": {
"percentage": 0.1
}
},
"id": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.policyinsights/remediations/storageRemediation",
"name": "storageRemediation",
"type": "Microsoft.PolicyInsights/remediations",
"systemData": {
"createdBy": "b69a9388-9488-4534-b470-7ec6d41beef6",
"createdByType": "User",
"createdAt": "2018-09-12T20:58:58.7531298Z",
"lastModifiedBy": "b69a9388-9488-4534-b470-7ec6d41beef6",
"lastModifiedByType": "User",
"lastModifiedAt": "2018-09-12T20:58:58.7531298Z"
}
}
定义
createdByType
创建资源的标识类型。
名称 |
类型 |
说明 |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
ErrorDefinition
错误定义。
名称 |
类型 |
说明 |
additionalInfo
|
TypedErrorInfo[]
|
其他特定于方案的错误详细信息。
|
code
|
string
|
服务特定的错误代码,用作 HTTP 错误代码的子状态。
|
details
|
ErrorDefinition[]
|
内部错误详细信息。
|
message
|
string
|
错误的说明。
|
target
|
string
|
错误的目标。
|
ErrorResponse
错误响应。
FailureThreshold
修正失败阈值设置
名称 |
类型 |
说明 |
percentage
|
number
|
一个介于 0.0 到 1.0 之间的数字,表示失败百分比阈值。 如果失败的修正操作百分比 (即失败的部署) 超过此阈值,则修正将失败。
|
修正定义。
名称 |
类型 |
说明 |
id
|
string
|
修正的 ID。
|
name
|
string
|
修正的名称。
|
properties.correlationId
|
string
|
修正关联 ID。可用于在活动日志中查找与修正相关的事件。
|
properties.createdOn
|
string
|
创建修正的时间。
|
properties.deploymentStatus
|
RemediationDeploymentSummary
|
修正创建的所有部署的部署状态摘要。
|
properties.failureThreshold
|
FailureThreshold
|
修正失败阈值设置
|
properties.filters
|
RemediationFilters
|
将应用于确定要修正的资源的筛选器。
|
properties.lastUpdatedOn
|
string
|
上次更新修正的时间。
|
properties.parallelDeployments
|
integer
|
确定在任何给定时间要修正的资源数。 可用于增加或减少修正的速度。 如果未提供,则使用默认的并行部署值。
|
properties.policyAssignmentId
|
string
|
应修正的策略分配的资源 ID。
|
properties.policyDefinitionReferenceId
|
string
|
应修正的单个定义的策略定义引用 ID。 当正在修正的策略分配分配策略集定义时是必需的。
|
properties.provisioningState
|
string
|
修正的状态。 这指的是整个修正任务,而不是单个部署。 允许的值为“评估”、“已取消”、“正在取消”、“失败”、“完成”或“成功”。
|
properties.resourceCount
|
integer
|
确定修正作业可以修正的最大资源数。 如果未提供,则使用默认资源计数。
|
properties.resourceDiscoveryMode
|
ResourceDiscoveryMode
|
发现要修正的资源的方式。 如果未指定,则默认为 ExistingNonCompliant。
|
properties.statusMessage
|
string
|
修正状态消息。 提供有关修正状态的其他详细信息。
|
systemData
|
systemData
|
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。
|
type
|
string
|
修正的类型。
|
修正创建的所有部署的部署状态摘要。
名称 |
类型 |
说明 |
failedDeployments
|
integer
|
修正所需的失败部署数。
|
successfulDeployments
|
integer
|
修正成功所需的部署数。
|
totalDeployments
|
integer
|
修正所需的部署数。
|
将应用于确定要修正的资源的筛选器。
名称 |
类型 |
说明 |
locations
|
string[]
|
要修正的资源位置。
|
ResourceDiscoveryMode
发现要修正的资源的方式。 如果未指定,则默认为 ExistingNonCompliant。
名称 |
类型 |
说明 |
ExistingNonCompliant
|
string
|
修正已知不合规的资源。
|
ReEvaluateCompliance
|
string
|
重新评估资源的符合性状态,然后修正发现不合规的资源。
|
systemData
与资源的创建和上次修改相关的元数据。
名称 |
类型 |
说明 |
createdAt
|
string
|
资源创建时间戳 (UTC) 。
|
createdBy
|
string
|
创建资源的标识。
|
createdByType
|
createdByType
|
创建资源的标识类型。
|
lastModifiedAt
|
string
|
资源上次修改的时间戳 (UTC)
|
lastModifiedBy
|
string
|
上次修改资源的标识。
|
lastModifiedByType
|
createdByType
|
上次修改资源的标识类型。
|
TypedErrorInfo
特定于方案的错误详细信息。
名称 |
类型 |
说明 |
info
|
|
特定于方案的错误详细信息。
|
type
|
string
|
包含的错误详细信息的类型。
|