Documentation is now available for the Fall 2020 Update release!

Create device management policy

This endpoint is used to create a device management policy with required filters on the resources.

Leave Feedback

URL

POST https://{api-url}/api/v2/tenants/{tenantId}/policies/management

Sample URLs

https://{api-url}/api/v2/tenants/client_93/policies/management

Parameters

All fields are mandatory:

FieldDescription
nameName of the policy.
resourceTypeType of resource.
Example: DEVICE, VOLUME, VPN, XENSERVER
matchTypeValues: ANY or ALL:
  • ANY - Value is returned if ANY of the given filter criteria matches.
  • ALL - Value is returned if ALL the filter criteria match.
rulesSelect at least one rule.
Rule examples: "key": "Name", "operator": "Contains", and "value": "gateway".
Operator Values: Contains, Not Contains, Equals, Not Equals, Starts with, Ends with, Regex, Is([TRUE, FALSE]
actionRefers to the actions performed on the filtered resources. Select at least one of the following actions:

  • Assign Monitoring Templates
  • Assign Knowledge Base Articles
  • Assign Availability Rule
  • Assign Custom Attributes
  • Assign Jobs
  • Assign Credentials



Examples: "ASSIGN MONITORINGTEMPLATE" and "ASSIGN KNOWLEDGEARTICLE"

Sample 1: Assign all actions

Sample 1 request

[{
    "name": "all actions",
    "matchType": "ALL",
    "rules": [
        {
            "id": 182208,
            "key": "Name",
            "operator": "Contains",
            "value": "test",
            "resourceType": "DEVICE",
            "isNativeAttribute": true
        }
    ],
    "actions": [
        {
            "action": "ASSIGN MONITORINGTEMPLATE",
            "items": [
                {
                    "item": "4053",
                    "parameters": {
                        "Packet Count": "3",
                        "Packet interval": "1000",
                        "Data Bytes": "64"
                    },
                    "instances": {
                    }
                }
            ],
            "forceAssignOrUnassign": false
        },
        {
            "action": "ASSIGN KNOWLEDGEARTICLE",
            "items": [
                {
                    "item": "7188"
                }
            ],
            "forceAssignOrUnassign": true
        },
        {
            "action": "Assign Jobs",
            "items": [
                {
                    "item": "asset info",
                    "itemType": "assetinfo",
                    "itemUid": "c072cd67-779a-4206-a3d9-7c761fd563d8"
                }
            ],
            "forceAssignOrUnassign": true
        },
        {
            "action": "Assign Availability Rule",
            "items": [
                {
                    "item": "AND"
                }
            ]
        },
        {
            "action": "ASSIGN CREDENTIALSET",
            "items": [
                {
                    "item": "36218"
                }
            ],
            "forceAssignOrUnassign": true
        },
        {
            "action": "ASSIGN CUSTOMATTRIBUTES",
            "items": [
                {
                    "item": "264313"
                }
            ],
            "forceAssignOrUnassign": true
        }
    ]
}]

Sample 1 response

[
    {
    "id": 85908,
    "uid": "POLICY-4eb7d892-91dc-4ba9-bc92-980effbea64f",
    "name": "all actions",
    "matchType": "ALL",
    "rules": [
        {
            "id": 182208,
            "key": "Name",
            "operator": "Contains",
            "value": "test",
            "resourceType": "DEVICE",
            "isNativeAttribute": true
        }
    ],
    "actions": [
        {
            "action": "ASSIGN MONITORINGTEMPLATE",
            "items": [
                {
                    "item": "4053",
                    "parameters": {
                        "Packet Count": "3",
                        "Packet interval": "1000",
                        "Data Bytes": "64"
                    },
                    "instances": {
                    }
                }
            ],
            "forceAssignOrUnassign": false
        },
        {
            "action": "ASSIGN KNOWLEDGEARTICLE",
            "items": [
                {
                    "item": "7188"
                }
            ],
            "forceAssignOrUnassign": true
        },
        {
            "action": "Assign Jobs",
            "items": [
                {
                    "item": "asset info",
                    "itemType": "assetinfo",
                    "itemUid": "c072cd67-779a-4206-a3d9-7c761fd563d8"
                }
            ],
            "forceAssignOrUnassign": true
        },
        {
            "action": "Assign Availability Rule",
            "items": [
                {
                    "item": "AND"
                }
            ]
        },
        {
            "action": "ASSIGN CREDENTIALSET",
            "items": [
                {
                    "item": "36218"
                }
            ],
            "forceAssignOrUnassign": true
        },
        {
            "action": "ASSIGN CUSTOMATTRIBUTES",
            "items": [
                {
                    "item": "264313"
                }
            ],
            "forceAssignOrUnassign": true
        }
    ]
}
]

Sample 2: Assign Knowledge base article with unique ID

Sample 2 request

[
	{
		"name" : "TestArticle",
		"matchType" : "ALL",
		"rules" : [
			{
				"key" : "Name",
				"operator" : "Contains",
				"value" : "desktop",
				"resourceType": "DEVICE",
            	"isNativeAttribute": true
			}
		],
		"actions": [
        {
            "action": "ASSIGN KNOWLEDGEARTICLE",
            "items": [
                {
                    "item": "KB0000000123"
                }
            ],
            "forceAssignOrUnassign": true
        }
    ]
	}
]

Sample 2 response

[
    {
        "id": 9,
        "uid": "POLICY-ef02531c-b090-4535-8e83-968f00787fa6",
        "name": "TestArticle",
        "matchType": "ALL",
        "rules": [
            {
                "id": 16,
                "key": "Name",
                "operator": "Contains",
                "value": "desktop",
                "resourceType": "DEVICE",
                "isNativeAttribute": true
            }
        ],
        "actions": [
            {
                "action": "ASSIGN KNOWLEDGEARTICLE",
                "items": [
                    {
                        "item": "KB0000000123"
                    }
                ],
                "forceAssignOrUnassign": true
            }
        ]
    }
]