你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn 。
Custom Recommendations - Delete
本文内容
URI 参数
响应
安全性
示例
定义
删除给定范围内的自定义建议
DELETE https://management.azure.com/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}?api-version=2024-08-01
展开表
名称
在
必需
类型
说明
customRecommendationName
path
True
string
自定义建议的名称。
正则表达式模式: [{]?[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$
scope
path
True
string
自定义建议的范围。 有效范围包括:管理组(格式:“providers/Microsoft.Management/managementGroups/{managementGroup}”)、订阅(格式:'subscriptions/{subscriptionId}')或安全连接器(格式:'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'
api-version
query
True
string
用于此操作的 API 版本。
展开表
名称
类型
说明
200 OK
确定 - 已删除自定义建议
204 No Content
无内容 - 自定义建议不存在
Other Status Codes
ErrorResponse
描述操作失败的原因的错误响应。
Azure Active Directory OAuth2 Flow
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
展开表
名称
说明
user_impersonation
模拟用户帐户
展开表
Delete a custom recommendation over management group scope
示例请求
DELETE https://management.azure.com/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/customRecommendations/ad9a8e26-29d9-4829-bb30-e597a58cdbb8?api-version=2024-08-01
/**
* Samples for CustomRecommendations Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/
* DeleteByManagementGroupCustomRecommendation_example.json
*/
/**
* Sample code: Delete a custom recommendation over management group scope.
*
* @param manager Entry point to SecurityManager.
*/
public static void deleteACustomRecommendationOverManagementGroupScope(
com.azure.resourcemanager.security.SecurityManager manager) {
manager.customRecommendations().deleteByResourceGroupWithResponse(
"providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8",
com.azure.core.util.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
Delete a custom recommendation over security connector scope
示例请求
DELETE https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/customRecommendations/ad9a8e26-29d9-4829-bb30-e597a58cdbb8?api-version=2024-08-01
/**
* Samples for CustomRecommendations Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/
* DeleteBySecurityConnectorCustomRecommendation_example.json
*/
/**
* Sample code: Delete a custom recommendation over security connector scope.
*
* @param manager Entry point to SecurityManager.
*/
public static void deleteACustomRecommendationOverSecurityConnectorScope(
com.azure.resourcemanager.security.SecurityManager manager) {
manager.customRecommendations().deleteByResourceGroupWithResponse(
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector",
"ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.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
Delete a custom recommendation over subscription scope
示例请求
DELETE https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/customRecommendations/1f3afdf9-d0c9-4c3d-847f-89da613e70a8?api-version=2024-08-01
/**
* Samples for CustomRecommendations Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/stable/2024-08-01/examples/CustomRecommendations/
* DeleteBySubscriptionCustomRecommendation_example.json
*/
/**
* Sample code: Delete a custom recommendation over subscription scope.
*
* @param manager Entry point to SecurityManager.
*/
public static void
deleteACustomRecommendationOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) {
manager.customRecommendations().deleteByResourceGroupWithResponse(
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
com.azure.core.util.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
展开表
资源管理错误附加信息。
展开表
名称
类型
说明
info
object
其他信息。
type
string
其他信息类型。
错误详细信息。
展开表
错误响应
展开表