Select the tab
ESET Connect – Table of Contents

POST Assign policy

Relative path: /v2/policy-assignments

Create a policy assignment.

Assignments to the same targets are ordered and prioritized.

Every new assignment to the target is put at the end of the stack. The assignment ranking will be equal to the number of target's assignments.

Ranking 1 is the highest, and policies are merged from rank 1 towards lower ranks.

Info:
A similar concept is described in Group assignment ranking

Base URL for Europe, Germany, United States, Canada and Japan regions:






Request body

Display Schema instead of an Example or vice-versa

Type

Required

Example

Schema

application/json

Yes

{
  "assignment": {
    "policyUuid": "string",
    "rank": 0,
    "target": {
      "deviceUuid": "string",
      "deviceGroupUuid": "string",
      "subscriptionUuid": "string"
    },
    "uuid": "string"
  }
}
{
  "$ref": "v2AssignPolicyRequest",
  "assignment": {
    "$ref": "v2PolicyAssignment",
    "description": "Relation between policy and target. One target can have multiple policies assigned. Those policies are combined according to their ranking.",
    "policyUuid": {
      "type": "string",
      "description": "Assigned policy. type: Policy"
    },
    "rank": {
      "type": "integer",
      "description": "Ranking within multiple assignments to the target. Rank 1 is the highest rank, that is, the rank of the highest priority. Policies are applied in order from the highest rank to the lowest.",
      "format": "int64",
      "readOnly": true
    },
    "target": {
      "$ref": "v2PolicyTarget",
      "description": "Identifies the entity to which the policy is assigned.",
      "deviceUuid": {
        "type": "string",
        "description": "Policy is assigned to [device]. type: device_management.v1.Device"
      },
      "deviceGroupUuid": {
        "type": "string",
        "description": "Policy is assigned to [device group]. type: device_management.v1.DeviceGroup"
      },
      "subscriptionUuid": {
        "type": "string",
        "description": "Policy is assigned to [subscription]. type: subscription_provisioning.v2.Subscription"
      }
    },
    "uuid": {
      "type": "string",
      "description": "Unique identifier of the entity. Must be collision-free - two identifiers created anywhere in the world must not collide within entity parent scope. Unless a member of aggregate, the entity scope is always global. Although most of the times compliant with RFC 4122: A Universally Unique IDentifier (UUID) URN Namespace, do not rely on it being a RFC UUID. Treat it as an opaque identifier. RFC UUID can be recognized by being formatted according to the template xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, as explained on Wikipedia. UUID is used for referencing an entity, even across domains. Example: '123e4567-e89b-12d3-a456-426614174000'",
      "readOnly": true
    }
  }
}


Responses

Display Schema+Headers instead of an Example or vice-versa

Code

Description and Example

Description, Schema and Headers

200

Successful response.


Response example

{
  "assignment": {
    "policyUuid": "string",
    "rank": 0,
    "target": {
      "deviceUuid": "string",
      "deviceGroupUuid": "string",
      "subscriptionUuid": "string"
    },
    "uuid": "string"
  }
}

Successful response.


Response schema

{
  "$ref": "v2AssignPolicyResponse",
  "assignment": {
    "$ref": "v2PolicyAssignment",
    "description": "Relation between policy and target. One target can have multiple policies assigned. Those policies are combined according to their ranking.",
    "policyUuid": {
      "type": "string",
      "description": "Assigned policy. type: Policy"
    },
    "rank": {
      "type": "integer",
      "description": "Ranking within multiple assignments to the target. Rank 1 is the highest rank, that is, the rank of the highest priority. Policies are applied in order from the highest rank to the lowest.",
      "format": "int64",
      "readOnly": true
    },
    "target": {
      "$ref": "v2PolicyTarget",
      "description": "Identifies the entity to which the policy is assigned.",
      "deviceUuid": {
        "type": "string",
        "description": "Policy is assigned to [device]. type: device_management.v1.Device"
      },
      "deviceGroupUuid": {
        "type": "string",
        "description": "Policy is assigned to [device group]. type: device_management.v1.DeviceGroup"
      },
      "subscriptionUuid": {
        "type": "string",
        "description": "Policy is assigned to [subscription]. type: subscription_provisioning.v2.Subscription"
      }
    },
    "uuid": {
      "type": "string",
      "description": "Unique identifier of the entity. Must be collision-free - two identifiers created anywhere in the world must not collide within entity parent scope. Unless a member of aggregate, the entity scope is always global. Although most of the times compliant with RFC 4122: A Universally Unique IDentifier (UUID) URN Namespace, do not rely on it being a RFC UUID. Treat it as an opaque identifier. RFC UUID can be recognized by being formatted according to the template xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, as explained on Wikipedia. UUID is used for referencing an entity, even across domains. Example: '123e4567-e89b-12d3-a456-426614174000'",
      "readOnly": true
    }
  }
}


Headers

{
  "request-id": {
    "description": "Unique ID of the request. Include in support requests.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
}

202

Response took too long; request cached. Response can be retrieved later using the response-id header.

Response took too long; request cached. Response can be retrieved later using the response-id header.


Response schema

[]


Headers

{
  "response-id": {
    "description": "Unique ID of a pending request. Used to retrieve cached result.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  },
  "request-id": {
    "description": "Unique ID of the request. Include in support requests.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
}

400

One of the errors: 1. Bad or missing authorization. 2. Validation error. Invalid argument provided.

One of the errors: 1. Bad or missing authorization. 2. Validation error. Invalid argument provided.


Response schema

[]


Headers

{
  "request-id": {
    "description": "Unique ID of the request. Include in support requests.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
}

401

Token has expired or is invalid.

Token has expired or is invalid.


Response schema

[]


Headers

{
  "request-id": {
    "description": "Unique ID of the request. Include in support requests.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
}

403

Access denied. Check permissions.

Access denied. Check permissions.


Response schema

[]


Headers

{
  "request-id": {
    "description": "Unique ID of the request. Include in support requests.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
}

404

Requested resource not found.

Requested resource not found.


Response schema

[]


Headers

{
  "request-id": {
    "description": "Unique ID of the request. Include in support requests.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
}

429

Rate limit reached. Try again later.

Rate limit reached. Try again later.


Response schema

[]


Headers

{
  "request-id": {
    "description": "Unique ID of the request. Include in support requests.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
}

500

Internal server failure. Try again later.

Internal server failure. Try again later.


Response schema

[]


Headers

{
  "request-id": {
    "description": "Unique ID of the request. Include in support requests.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
}

502

Internal server failure. Try again later.

Internal server failure. Try again later.


Response schema

[]


Headers

{
  "request-id": {
    "description": "Unique ID of the request. Include in support requests.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
}

503

Environment under maintenance. Try again later.

Environment under maintenance. Try again later.


Response schema

[]


Headers

{
  "request-id": {
    "description": "Unique ID of the request. Include in support requests.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
}

504

Action took too long; timeout reached

Action took too long; timeout reached


Response schema

[]


Headers

{
  "request-id": {
    "description": "Unique ID of the request. Include in support requests.",
    "style": "simple",
    "explode": false,
    "schema": {
      "type": "string",
      "format": "uuid"
    }
  }
}