Length Exceeds Function (REST API)

Learn how to create a custom transform entity type to detect string lengths using the DryvIQ REST API.


Overview

DryvIQ offers a custom entity type that tests string property length against a specified limit. The entity type must be created manually through DeyvIQ’s REST API (using Postman or a command line tool such as PowerShell).

Creating the Entity Type

Endpoint

The REST endpoint for the call is  {{url}}v1/entity_types?fields=all, where {{url}} should be replaced with the base URL of your DryvIQ Platform installation (for example, https://192.168.6.14:32700/).

Request Format

Format the body of the request like the sample below.

{
 "kind": "transform",
 "property": "path_exceeds_400",
 "name": "Path Exceeds 400 Chars",
 "description": "Sample adhoc 'transformer' entity type that detects when file path exceeds the number of charaters specified.",
 "category": {
     "id": "3e7f1c1c941243919091bf9ee5d0f892"
 },
 "expression": "LengthExceeds([file_path], 400)"
}

 

Property Value
kind This value must be “transform”
property This must be a unique value. DryvIQ recommends using “path_exceeds_#,” where # is replaced with the value you want to use for the entity type. The sample above uses 400 since this is the value used in the expression property. 
name Enter a name for the entity type you are creating. This name is displayed in the user interface, so ensure it readily identifies the entity type function. The sample above uses “Path Exceeds 400 Chars” to indicate that this entity type identifies paths exceeding 400 characters. 
description The description is available only when viewing the entity type details. It is limited to 256 characters and helps users understand what the entity type is attempting to accomplish. 
cateory: id You must use 3e7f1c1c941243919091bf9ee5d0f892 as the ID. 
expression You must use LengthExceeds([file_path], #), where # is the value you want to use. This value can be any number greater than 0. 

Viewing the Entity Type in the DryvIQ Platform

Once created, you can view the entity type in the Entity Types section (under Manage in the left menu).

 

Using the Entity Type

  1. Add the Entity Type to the scan: When adding the scan categories to a content scan, you will find the entity type in the Miscellaneous category.
  2. Enable the new Column: A new Boolean column will be available when the initial scan completes. To display this column, use the Edit Columns feature on the Contents page.
  3. View the Results: In the Contents grid, items exceeding the specified value will display a check mark.
  4. Refine the Results: Use the Refine option to filter the content based on the new column.