URL
PUT https://{api-url}/api/v2/tenants/{tenantId}/policies/management
Sample URLs
https://{api-url}/api/v2/tenants/client_105261/policies/management
Parameters
All fields are mandatory:
Field | Description |
---|---|
name | Name of the policy. |
resourceType | Type of resource. Example: DEVICE, VOLUME, VPN, XENSERVER |
matchType | The values accepted are ANY or ALL:
|
rules | Select at least one rule. Examples: "key": "Name", "operator": "Contains", and "value": "gateway." |
action | Select at least one action. Examples: "ASSIGN MONITORINGTEMPLATE" and "ASSIGN KNOWLEDGEARTICLE" |
Status code
200 OK
Sample request
[
{
"id": 1790,
"name": "Mysql-policy",
"resourceType": "DEVICE",
"matchType": "ALL",
"rules": [
{
"key": "Name",
"operator": "Contains",
"value": "dc01-mysql-"
}
],
"actions": [
{
"action": "ASSIGN MONITORINGTEMPLATE",
"items": [
{
"item": "4053",
"parameters": {
"Packet Count": "3",
"Packet interval": "1000",
"Data Bytes": "64"
},
"instances": {
}
}
],
"forceAssignOrUnassign": false
},
{
"action": "ASSIGN CREDENTIALSET",
"items": [
{
"item": "36218"
}
],
"forceAssignOrUnassign": true
}
],
"executionOrder": 0
}
]
Sample response
[
{
"id": 1790,
"name": "Mysql-policy",
"resourceType": "DEVICE",
"matchType": "ALL",
"rules": [
{
"key": "Name",
"operator": "Contains",
"value": "dc01-mysql-"
}
],
"actions": [
{
"action": "ASSIGN MONITORINGTEMPLATE",
"items": [
{
"item": "4053",
"parameters": {
"Packet Count": "3",
"Packet interval": "1000",
"Data Bytes": "64"
},
"instances": {
}
}
],
"forceAssignOrUnassign": false
},
{
"action": "ASSIGN CREDENTIALSET",
"items": [
{
"item": "36218"
}
],
"forceAssignOrUnassign": true
}
],
"executionOrder": 0
}
]
The attribute forceAssignOrUnassign is not applicable to the ASSIGN AVAILABILITY action.