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
matchTypeThe values accepted are 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.
Examples: "key": "Device Name", "operator": "Contains", and "value": "gateway."
actionSelect at least one action. Examples: "ASSIGN MONITORINGTEMPLATE" and "ASSIGN KNOWLEDGEARTICLE"

Sample request

[{
    "name": "all actions",
    "matchType": "ALL",
    "rules": [
        {
            "id": 182208,
            "key": "Device 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 response

[
    {
    "id": 85908,
    "uid": "POLICY-4eb7d892-91dc-4ba9-bc92-980effbea64f",
    "name": "all actions",
    "matchType": "ALL",
    "rules": [
        {
            "id": 182208,
            "key": "Device 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
        }
    ]
}
]

The attribute forceAssignOrUnassign is not applicable to the ASSIGN AVAILABILITY action.