This page covers configuration and management of View metadata rule objects.

Object Overview

Metadata rules define how metadata is generated and where resultant metadata is stored within View.

Endpoint, URL, and Supported Methods

Objects are managed via the configuration server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/metadatarules

Supported methods include: GET HEAD PUT DELETE

Structure

Objects have the following structure:

{
    "GUID": "example-metadata-rule",
    "TenantGUID": "default",
    "BucketGUID": "example-data-bucket",
    "OwnerGUID": "default",
    "GraphRepositoryGUID": "default",
    "Name": "example-metadata-rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
    "ProcessingAccessKey": "default",
    "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
    "CleanupAccessKey": "default",
    "MinChunkContentLength": 2,
    "MaxChunkContentLength": 2048,
    "MaxTokensPerChunk": 1920,
    "ShiftSize": 1920,
    "ImageTextExtraction": true,
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://localhost:8000/",
    "DataCatalogAccessKey": "default",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "00000000-0000-0000-0000-000000000000",
    "CreatedUtc": "2025-03-25T11:40:49.283297Z"
}

Properties:

  • GUID GUID globally unique identifier for the object
  • TenantGUID GUID globally unique identifier for the tenant
  • BucketGUID GUID GUID of the bucket to which this metadata rule should be associated
  • OwnerGUID GUID GUID of the user to which this rule should be attributed
  • GraphRepositoryGUID GUIDthe GUID of the graph repository to which document metadata should be emitted
  • Name string name of the object
  • ContentType string content-type on which this rule should match
  • MaxContentLength int maximum content length on which this rule should match
  • ProcessingEndpoint string the URL to be used to generate metadata for matching objects
  • ProcessingAccessKey stringaccess key to ProcessingEndpoint
  • CleanupEndpoint string the URL to be used should a matching object be deleted
  • CleanupAccessKey stringaccess key to CleanupEndpoint
  • MinChunkContentLength int the minimum chunk content length
  • MaxChunkContentLength int the maximum chunk content length
  • MaxTokensPerChunk int the maximum token per chunk
  • ShiftSize int the number of bytes to shift while extracting content
  • ImageTextExtraction boolean Image text extraction.
  • TopTerms int the number of top terms to extract
  • CaseInsensitive bool Boolean flag to indicate whether or not case-insensitive text extraction should be used
  • IncludeFlattened bool Boolean flag to indicate whether or not a flattened representation of the object should be produced
  • DataCatalogEndpoint string the URL for the data catalog, typically Lexi, to which results should be emitted
  • DataCatalogAccessKey string access key to DataCatalogEndpoint
  • DataCatalogType enum type of data catalog, one of: Lexi
  • DataCatalogCollection string the name of the data catalog collection
  • CreatedUtc datetime timestamp from creation, in UTC time

Important: the user's password is never stored by View, but rather the SHA-256 hash within the PasswordSha256 property. As such this property is redacted when retrieving, enumerating, or updating the user object.

Create

To create, call PUT /v1.0/tenants/[tenant-guid]/metadatarules with the following properties using the configuration server: BucketGUID OwnerGUID Name ContentType ProcessingEndpoint ProcessingAccessKey CleanupEndpoint CleanupAccessKey MaxChunkContentLength MinChunkContentLength ShiftSize TopTerms MaxTokensPerChunk``CaseInsensitive IncludeFlattened DataCatalogEndpoint DataCatalogAccessKey DataCatalogType DataCatalogCollection MaxContentLength

curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules' \
--header 'content-type: application/json' \
--header 'Authorization: Bearer default' \
--data '{
    "BucketGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "example-metadata-rule-ash",
    "OwnerGUID": "00000000-0000-0000-0000-000000000000",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
    "ProcessingAccessKey": "default",
    "CleanupEndpoint": "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
    "CleanupAccessKey": "default",
    "MinChunkContentLength": 2,
    "MaxChunkContentLength": 2048,
    "MaxTokensPerChunk": 1920,
    "ShiftSize": 256,
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://localhost:8000/",
    "DataCatalogAccessKey": "default",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "00000000-0000-0000-0000-000000000000",
    "GraphRepositoryGUID": "00000000-0000-0000-0000-000000000000"
}'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);

export const createMetaDataRules = async () => {
  try {
    const response = await api.createMetadataRule({
      BucketGUID: "00000000-0000-0000-0000-000000000000",
      Name: "example-metadata-rule",
      ContentType: "*",
      MaxContentLength: 134217728,
      ProcessingEndpoint:
        "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
      ProcessingAccessKey: "default",
      CleanupEndpoint:
        "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
      CleanupAccessKey: "default",
      MinChunkContentLength: 2,
      MaxChunkContentLength: 2048,
      MaxTokensPerChunk: 1920,
      ShiftSize: 256,
      TopTerms: 25,
      CaseInsensitive: true,
      IncludeFlattened: true,
      DataCatalogEndpoint: "http://localhost:8000/",
      DataCatalogAccessKey: "default",
      DataCatalogType: "Lexi",
      DataCatalogCollection: "00000000-0000-0000-0000-000000000000",
      GraphRepositoryGUID: "00000000-0000-0000-0000-000000000000",
    });
    console.log(response, "Meta data rules created successfully");
  } catch (err) {
    console.log("Error creating Meta data rules:", err);
  }
};

createMetaDataRules();

Enumerate

Refer to the Enumeration page in REST API for details about the use of enumeration APIs.

Enumerate objects by using GET /v2.0/tenants/[tenant-guid]/metadatarules. The resultant object will appear as:

{
    "Success": true,
    "Timestamp": {
        "Start": "2024-10-21T02:36:37.677751Z",
        "TotalMs": 23.58,
        "Messages": {}
    },
    "MaxResults": 10,
    "IterationsRequired": 1,
    "EndOfResults": true,
    "RecordsRemaining": 16,
    "Objects": [
        {
            "GUID": "example-metadatarule",
            ... metadatarule details ...
        },
        { ... }
    ],
    "ContinuationToken": "[continuation-token]"
}
curl --location 'http://view.homedns.org:8000/v2.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);

export const enumerateMetaDataRules = async () => {
  try {
    const response = await api.enumerateMetadataRules();
    console.log(response, "Metadata rules fetched successfully");
  } catch (err) {
    console.log("Error fetching Metadata rules:", err);
  }
};

enumerateMetaDataRules();

Read

To read an object by GUID, call GET /v1.0/tenants/[tenant-guid]/metadatarules/[metadatarule-guid]. If the object exists, it will be returned as a JSON object in the response body. If it does not exist, a 404 will be returned with a NotFound error response.

{
    "GUID": "example-metadata-rule",
    "TenantGUID": "default",
    "BucketGUID": "example-data-bucket",
    "OwnerGUID": "default",
    "Name": "example-metadata-rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
    "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
    "TypeDetectorEndpoint": "http://nginx-orchestrator:8501/processor/typedetector",
    "SemanticCellEndpoint": "http://nginx-semcell:8341/",
    "MinChunkContentLength": 2,
    "MaxChunkContentLength": 2048,
    "ShiftSize": 1920,
    "UdrEndpoint": "http://nginx-processor:8321/",
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://nginx-lexi:8201/",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "default",
    "GraphRepositoryGUID": "example-graph-repository",
    "TargetBucketGUID": "example-udr-bucket",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}
curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
 );

export const getMetaDataRule = async () => {
  try {
    const response = await api.retrieveMetadataRule(
      "00000000-0000-0000-0000-000000000000"
    );
    console.log(response, "Metadata rule fetched successfully");
  } catch (err) {
    console.log("Error fetching Metadata rule:", err);
  }
};

getMetaDataRule();

Note: the HEAD method can be used as an alternative to get to simply check the existence of the object. HEAD requests return either a 200/OK in the event the object exists, or a 404/Not Found if not. No response body is returned with a HEAD request.

Read All

To read all objects, call GET /v1.0/tenants/[tenant-guid]/metadatarules/. If the object exists, it will be returned as an array of JSON object in the response body

curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
 );

export const getMetaDataRules = async () => {
  try {
    const response = await api.retrieveMetadataRules();
    console.log(response, "Metadata rules fetched successfully");
  } catch (err) {
    console.log("Error fetching Metadata rules:", err);
  }
};

getMetaDataRules();

Update

To update an object by GUID, call PUT /v1.0/tenants/[tenant-guid]/metadatarules/[metadatarule-guid] with a fully populated object in the request body. The updated object will be returned to you.

Note: certain fields cannot be modified and will be preserved across updates.

Request body:

{
    "BucketGUID": "example-data-bucket",
    "OwnerGUID": "default",
    "Name": "Updated metadata rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
    "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
    "TypeDetectorEndpoint": "http://nginx-orchestrator:8501/processor/typedetector",
    "SemanticCellEndpoint": "http://nginx-semcell:8341/",
    "MinChunkContentLength": 2,
    "MaxChunkContentLength": 2048,
    "ShiftSize": 1920,
    "UdrEndpoint": "http://nginx-processor:8321/",
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://nginx-lexi:8201/",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "default",
    "GraphRepositoryGUID": "example-graph-repository",
    "TargetBucketGUID": "example-udr-bucket",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}
curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/00000000-0000-0000-0000-000000000000' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "BucketGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My updated metadata rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
    "ProcessingAccessKey": "default",
    "CleanupEndpoint": "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
    "CleanupAccessKey": "default",
    "MinChunkContentLength": 2,
    "MaxChunkContentLength": 2048,
    "MaxTokensPerChunk": 1920,
    "ShiftSize": 256,
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://localhost:8000/",
    "DataCatalogAccessKey": "default",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "00000000-0000-0000-0000-000000000000",
    "GraphRepositoryGUID": "00000000-0000-0000-0000-000000000000"
}'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
 );

export const updateMetaDataRule = async () => {
  try {
    const response = await api.updateMetadataRule({
      GUID: "fc02c566-78d9-4f7b-82e5-5688b92e6cfe",
      TenantGUID: "00000000-0000-0000-0000-000000000000",
      BucketGUID: "00000000-0000-0000-0000-000000000000",
      OwnerGUID: "00000000-0000-0000-0000-000000000000",
      GraphRepositoryGUID: "00000000-0000-0000-0000-000000000000",
      Name: "example-metadata-rule-updated-from-sdk",
      ContentType: "*",
      MaxContentLength: 134217728,
      ProcessingEndpoint:
        "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
      ProcessingAccessKey: "default",
      CleanupEndpoint:
        "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
      CleanupAccessKey: "default",
      MinChunkContentLength: 2,
      MaxChunkContentLength: 2048,
      MaxTokensPerChunk: 1920,
      ShiftSize: 256,
      ImageTextExtraction: true,
      TopTerms: 25,
      CaseInsensitive: true,
      IncludeFlattened: true,
      DataCatalogEndpoint: "http://localhost:8000/",
      DataCatalogAccessKey: "default",
      DataCatalogType: "Lexi",
      DataCatalogCollection: "00000000-0000-0000-0000-000000000000",
      CreatedUtc: "2025-03-25T12:19:28.976056Z",
    });
    console.log(response, "Metadata rule updated successfully");
  } catch (err) {
    console.log("Error updating Metadata rule:", err);
  }
};

updateMetaDataRule();

Response body:

{
    "GUID": "example-metadata-rule",
    "TenantGUID": "default",
    "BucketGUID": "example-data-bucket",
    "OwnerGUID": "default",
    "Name": "Updated metadata rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
    "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
    "TypeDetectorEndpoint": "http://nginx-orchestrator:8501/processor/typedetector",
    "SemanticCellEndpoint": "http://nginx-semcell:8341/",
    "MinChunkContentLength": 2,
    "MaxChunkContentLength": 2048,
    "ShiftSize": 1920,
    "UdrEndpoint": "http://nginx-processor:8321/",
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://nginx-lexi:8201/",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "default",
    "GraphRepositoryGUID": "example-graph-repository",
    "TargetBucketGUID": "example-udr-bucket",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}

Delete

To delete an object by GUID, call DELETE /v1.0/tenants/[tenant-guid]/metadatarule/[metadatarule-guid].

curl --location --request DELETE 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••' \
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
 );

export const deleteMetaDataRule = async () => {
  try {
    const response = await api.deleteMetadataRule(
      "dfdee78e-3f48-4199-a27b-988b4fee04c9"
    );
    console.log(response, "Metadata rule deleted successfully");
  } catch (err) {
    console.log("Error deleting Metadata rule:", err);
  }
};

deleteMetaDataRule();

Check existence

To check existence of an object by GUID, call HEAD /v1.0/tenants/[tenant-id]/metadatarules/[metadatarule-guid]

curl --location --head 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'