你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Policy Elements - List
获取给定范围的策略。
GET {endpoint}/pds/policy-elements?scope={scope}&api-version=2023-01-01
GET {endpoint}/pds/policy-elements?scope={scope}&filter={filter}&api-version=2023-01-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
endpoint
|
path | True |
string url |
Purview 帐户的终结点。 示例:https://{accountName}.purview.azure.com。 |
api-version
|
query | True |
string |
服务的 api 版本。 |
scope
|
query | True |
string |
Purview 管理的任何资源的 ID。 |
filter
|
query |
string |
支持完整 OData 语法的筛选器。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
Success |
|
Other Status Codes |
错误 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
PolicyElements_List
示例请求
GET {endpoint}/pds/policy-elements?scope=/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourcegroups/pansharm-rg/providers/microsoft.sql/servers/pansharm-sql&api-version=2023-01-01
示例响应
x-ms-correlation-request-id: f35b289b-7deb-467b-9976-a163926f981f
{
"syncToken": "25251:0",
"value": [
{
"id": "5f448cc9-33cc-47de-910c-c2de1212cb2f",
"kind": "Policy",
"updatedAt": "2022-04-12T09:43:35.4515155Z",
"version": 8,
"elementJson": "{\"id\":\"5f448cc9-33cc-47de-910c-c2de1212cb2f\",\"name\":\"test004\",\"kind\":\"policy\",\"version\":8,\"updatedAt\":\"2022-04-12T09:43:35.4515155Z\",\"decisionRules\":[{\"kind\":\"decisionrule\",\"effect\":\"Permit\",\"updatedAt\":\"04/12/2022 09:43:35\",\"cnfCondition\":[[{\"attributeName\":\"resource.azure.path\",\"attributeValueIncludedIn\":[\"/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourcegroups/pansharm-rg/providers/Microsoft.AzureArcData/SqlServerInstances/pansharm-sql/**\"]}],[{\"attributeName\":\"principal.microsoft.id\",\"attributeValueIncludedIn\":[\"ca4709b3-1fdd-4032-9844-3039025e8ee0\"]}],[{\"fromRule\":\"purviewdatarole_builtin_sqlperfmonitor\",\"attributeName\":\"derived.purview.role\",\"attributeValueIncludes\":\"purviewdatarole_builtin_sqlperfmonitor\"}]]}]}"
},
{
"id": "e870dcfa-d89d-4fc1-90a9-ef758d299e15",
"scopes": [
"/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourcegroups/pansharm-rg"
],
"kind": "PolicySet",
"updatedAt": "2022-03-07T05:21:52.2823168Z",
"version": 1,
"elementJson": "{\"id\":\"e870dcfa-d89d-4fc1-90a9-ef758d299e15\",\"name\":\"e870dcfa-d89d-4fc1-90a9-ef758d299e15\",\"kind\":\"policyset\",\"version\":1,\"updatedAt\":\"2022-03-07T05:21:52.2823168Z\",\"preconditionRules\":[{\"dnfCondition\":[[{\"attributeName\":\"resource.azure.path\",\"attributeValueIncludedIn\":[\"/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourcegroups/pansharm-rg/**\"]}]]}],\"policyRefs\":[\"5f448cc9-33cc-47de-910c-c2de1212cb2f\"]}"
}
]
}
x-ms-correlation-request-id: f35b289b-7deb-467b-9976-a163926f981f
{
"error": {
"code": "1001",
"message": "Simple error message.",
"target": "Detailed message or error trace.",
"details": []
}
}
定义
名称 | 说明 |
---|---|
Error |
默认错误模型。 |
Error |
默认错误响应模型。 |
Policy |
表示策略元素的类型。 |
Policy |
表示策略、策略集或属性规则。 |
Policy |
策略批量提取 API 的响应模型。 |
ErrorModel
默认错误模型。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误代码。 |
details |
错误详细信息。 |
|
message |
string |
错误消息。 |
target |
string |
错误说明。 |
ErrorResponseModel
默认错误响应模型。
名称 | 类型 | 说明 |
---|---|---|
error |
默认错误模型。 |
PolicyElementKind
表示策略元素的类型。
名称 | 类型 | 说明 |
---|---|---|
AttributeRule |
string |
|
Policy |
string |
|
PolicySet |
string |
PolicyElementUpdated
表示策略、策略集或属性规则。
名称 | 类型 | 说明 |
---|---|---|
elementJson |
string |
策略元素序列化的 json 有效负载。 |
id |
string |
策略元素的 ID。 |
kind |
表示策略元素的类型。 |
|
scopes |
string[] |
此策略中包含的范围列表。 |
updatedAt |
string |
上次更新此策略元素的时间。 |
version |
integer |
策略元素的当前版本。 每次更改都会自动递增。 从 1 开始。 |
PolicyResponseUpdated
策略批量提取 API 的响应模型。
名称 | 类型 | 说明 |
---|---|---|
nextLink |
string |
用于提取下一组策略元素的链接。 |
syncToken |
string |
此同步令牌表示策略的最新检查点。 客户端在使用策略事件 API 提取后续增量更改时需要传递此值。 |
value |
策略元素列表。 |