Metadata Policy - Update
Updates a metadata policy
PUT {Endpoint}/policyStore/metadataPolicies/{policyId}?api-version=2021-07-01-preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
Endpoint
|
path | True |
string |
The endpoint of your Purview account. Example: https://{accountName}.purview.azure.com. |
policy
|
path | True |
string |
Unique policy id. |
api-version
|
query | True |
string |
The api version to use. |
Request Body
Name | Type | Description |
---|---|---|
id |
string |
The id of policy |
name |
string |
The name of policy |
properties | ||
version |
integer |
The version of policy |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Success |
|
Other Status Codes |
An error response received from the Metadata Policy Service Headers x-ms-error-code: string |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
MetadataPolicy_Update
Sample request
PUT {Endpoint}/policyStore/metadataPolicies/98ed42ff-b67f-44df-8c8c-7e6b43e77055?api-version=2021-07-01-preview
{
"name": "policy_mycollection",
"id": "98ed42ff-b67f-44df-8c8c-7e6b43e77055",
"version": 1,
"properties": {
"description": "",
"decisionRules": [
{
"effect": "Permit",
"dnfCondition": [
[
{
"attributeName": "resource.purview.collection",
"attributeValueIncludes": "mycollection"
},
{
"attributeName": "derived.purview.permission",
"attributeValueIncludes": "permission:mycollection"
}
]
]
}
],
"attributeRules": [
{
"id": "purviewmetadatarole_builtin_collection-administrator:mycollection",
"name": "purviewmetadatarole_builtin_collection-administrator:mycollection",
"dnfCondition": [
[
{
"attributeName": "principal.microsoft.id",
"attributeValueIncludedIn": [
"69e520f2-5f26-4074-9fe1-5187d85ec005",
"3f10f245-d5c4-4541-98ce-01a4580a30e0"
]
},
{
"attributeName": "derived.purview.role",
"attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator"
}
],
[
{
"attributeName": "derived.purview.permission",
"attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator:myparentcollection"
}
]
]
},
{
"id": "permission:mycollection",
"name": "permission:mycollection",
"dnfCondition": [
[
{
"attributeName": "derived.purview.permission",
"attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator:mycollection"
}
],
[
{
"attributeName": "derived.purview.permission",
"attributeValueIncludes": "permission:myparentcollection"
}
]
]
}
],
"collection": {
"referenceName": "mycollection"
},
"parentCollectionName": "myparentcollection"
}
}
Sample response
x-ms-request-id: d5496da4-9c52-402f-b067-83cc9ddea888
{
"name": "policy_mycollection",
"id": "98ed42ff-b67f-44df-8c8c-7e6b43e77055",
"version": 2,
"properties": {
"description": "",
"decisionRules": [
{
"kind": "decisionrule",
"effect": "Permit",
"dnfCondition": [
[
{
"attributeName": "resource.purview.collection",
"attributeValueIncludes": "mycollection"
},
{
"attributeName": "derived.purview.permission",
"attributeValueIncludes": "permission:mycollection"
}
]
]
}
],
"attributeRules": [
{
"kind": "attributerule",
"id": "purviewmetadatarole_builtin_collection-administrator:mycollection",
"name": "purviewmetadatarole_builtin_collection-administrator:mycollection",
"dnfCondition": [
[
{
"attributeName": "principal.microsoft.id",
"attributeValueIncludedIn": [
"69e520f2-5f26-4074-9fe1-5187d85ec005",
"3f10f245-d5c4-4541-98ce-01a4580a30e0"
]
},
{
"attributeName": "derived.purview.role",
"attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator"
}
],
[
{
"attributeName": "derived.purview.permission",
"attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator:myparentcollection"
}
]
]
},
{
"kind": "attributerule",
"id": "permission:mycollection",
"name": "permission:mycollection",
"dnfCondition": [
[
{
"attributeName": "derived.purview.permission",
"attributeValueIncludes": "purviewmetadatarole_builtin_collection-administrator:mycollection"
}
],
[
{
"attributeName": "derived.purview.permission",
"attributeValueIncludes": "permission:myparentcollection"
}
]
]
}
],
"collection": {
"type": "CollectionReference",
"referenceName": "mycollection"
},
"parentCollectionName": "myparentcollection"
}
}
Definitions
Name | Description |
---|---|
Attribute |
Attribute matcher for a rule |
Attribute |
The attribute rule for a policy |
Collection |
The collection reference for a policy |
Decision |
The effect for rule |
Decision |
The decision rule for a policy |
Error |
The error model for metadata policy |
Error |
The error response model for metadata policy |
Kind |
The kind of rule |
Metadata |
|
Metadata |
AttributeMatcher
Attribute matcher for a rule
Name | Type | Description |
---|---|---|
attributeName |
string |
AttributeName |
attributeValueExcludedIn |
string[] |
List of values excluded for attribute |
attributeValueExcludes |
string |
Value excluded for attribute |
attributeValueIncludedIn |
string[] |
List of values for attribute |
attributeValueIncludes |
string |
Value for attribute |
AttributeRule
The attribute rule for a policy
Name | Type | Description |
---|---|---|
dnfCondition |
The dnf Condition for a rule |
|
id |
string |
The id for rule |
kind |
The kind of rule |
|
name |
string |
The name for rule |
CollectionReference
The collection reference for a policy
Name | Type | Default value | Description |
---|---|---|---|
referenceName |
string |
The name of reference |
|
type |
string |
CollectionReference |
The type of reference |
Decision
The effect for rule
Name | Type | Description |
---|---|---|
Deny |
string |
|
Permit |
string |
DecisionRule
The decision rule for a policy
Name | Type | Description |
---|---|---|
dnfCondition |
The dnf Condition for a rule |
|
effect |
The effect for rule |
|
kind |
The kind of rule |
ErrorModel
The error model for metadata policy
Name | Type | Description |
---|---|---|
code |
string |
The error code |
details |
The error details |
|
message |
string |
The error message |
target |
string |
The error target |
ErrorResponseModel
The error response model for metadata policy
Name | Type | Description |
---|---|---|
error |
The error model for metadata policy |
Kind
The kind of rule
Name | Type | Description |
---|---|---|
decisionrule |
string |
MetadataPolicy
Name | Type | Description |
---|---|---|
id |
string |
The id of policy |
name |
string |
The name of policy |
properties | ||
version |
integer |
The version of policy |
MetadataPolicyProperties
Name | Type | Description |
---|---|---|
attributeRules |
The AttributeRules of policy |
|
collection |
The collection reference for a policy |
|
decisionRules |
The DecisionRules of policy |
|
description |
string |
The description of policy |
parentCollectionName |
string |
The parent collection of the policy |