POST Metadata/SetPolicy
Assigns a Custom Field value to a policy.
Requirements
- Permissions: The caller must have Manage Policy permission to the Distinguished Name (DN) of policy in the request.
- Token scope: Configuration:Manage
Headers
-
Content type: Content-Type:application/json.
- Token: The bearer access token that you received. For example, Authorization:Bearer 4MyGeneratedBearerTknz==. For more information, see Passing a bearer token in your API calls.
Parameters
|
Name |
Description |
|---|---|
|
DN |
The Distinguished name (DN) of a policy folder that has values for at least one Custom Field. If necessary, use the DN value from the GET Metadata/Items or POST Metadata/GetItemsForClass response. |
|
ConfigClass |
The Device or X509 Certificate class. |
|
Locked (optional) |
Boolean indicating whether the value is to be locked by policy. If not specified, the value will not be locked by policy. |
|
GuidData |
An array of ItemGUID-List pairs. Each pair uniquely identifies a Custom Field and the value(s) to be assigned for the DN. To clear previously assigned values, leave the List empty.
|
Returns
|
Name |
Description |
|---|---|
|
Locked |
The status of the data:
|
|
Result |
The reason for success or failure. For more information, see Metadata Result Codes. |
Example: Lock values on Certificate Policy
Request
POST https://tpp.venafi.example/vedsdk/Metadata/SetPolicy
Authorization:Bearer 4MyGeneratedBearerTknz==
{
"DN": "\\VED\\Policy\\Certificates",
"ConfigClass": "X509 Certificate",
"Locked": true,
"GuidData": [
{
"ItemGuid": "{a80714f0-565c-4bc2-9026-787cf076d764}",
"List": ["XYZ789"]
}
]
}
Response
HTTP/1.1 200 OK
{
"Locked": true,
"Result": 0
}