Skip to content

Setup

Setup Enrichment Domains

Enricmment Domains are a lookup domain for Enrichment Data to which data can be associated. The Enrichment Domain is a simple string that is used to identify the domain. Lookup keys are defined within the domain and serve as the primary key for the lookup data. The lookup keys are used to match the lookup data to the Fitness Score data.

Configuration

The Enrichment Domain is configured using the following YAML:

kind: EnrichmentDomain
apiVersion: fitness.orcasio.com/v1alpha3
metadata:
  name: <name-of-enrichment-domain>
  namespace: <tenant_ID>
spec:
  enabled: true # Enable or Disable the Enrichment Domain
  lookupKeys: # Can be one or more lookup keys (simple or compound primary keys)
    key1: mapping-for-key1 # Lookup Key 1 -- mapped to the data
    key2: mapping.for.key2 # -- Mapping can be nested
    key3: key3 # Lookup Key 3

The following example showcases the configurations of an Enrichment Domain called "itil-info-domain" with a single lookup key called "appId" that is used to match the lookup data to the Fitness Score data.

Deployment

Deploy the Enrichment Domain to the cluster. You can download the configuration here: Enrichment-Domain

Note

Ensure all TODOs in the file are completed before applying the configuration to the cluster.

API Usage:

  • URI: (api-URL)/api/inventory/fitness.orcasio.com/v1alpha3/enrichmentdomains/<name_of_enrichmentDomain>
  • Method: POST
  • Header (for security): orcas-token: TOKEN (See TOKEN generation details above)
  • Header: Content-type: application/json
  • Request Body (JSON):

    {
      "data": {
        "kind": "EnrichmentDomain",
        "apiVersion": "fitness.orcasio.com/v1alpha3",
        "metadata": {
          "name": "<name_of_enrichmentDomain>",
          "namespace": "<tenant_ID>"
        },
        "spec": {
          "enabled": true,
          "lookupKeys": {
            "abc": "def.ghi"
          }
        }
      }
    }
    
  • Header: Content-type: application/x-yaml
  • Request Body (raw-text):

    data:
      kind: EnrichmentDomain
      apiVersion: fitness.orcasio.com/v1alpha3
      metadata:
        name: "<name_of_enrichmentDomain>"
        namespace: "<tenant_ID>"
      spec:
        enabled: true
        lookupKeys:
          abc: def.ghi
    

Sample Enrichment Domain Configurations

kind: EnrichmentDomain
apiVersion: fitness.orcasio.com/v1alpha3
metadata:
    name: <enrichment_domain_name>
    namespace: <tenant_ID>
spec:
    enabled: true
    lookupKeys:
        appId: appId
kind: EnrichmentDomain
apiVersion: fitness.orcasio.com/v1alpha3
metadata:
    name: <enrichment_domain_name>
    namespace: <tenant_ID>
spec:
    enabled: true
    lookupKeys:
        id: user_id
        director: director.name

Upload Enrichment Data

Once the enrichment domain is created, the enrichment data can be uploaded into the EnrichmentCache that can be lookedup by FitnessFunctions using the specified Lookup Keys. The EnrichmentCache can be uploaded as a JSON.

Steps to upload data

  1. Generate a new API Token for the Tenant

    Refer to Pre-Requisites to generate the API Token

  2. Upload data

    Use a REST client (ex: Postman/ARC/cURL) to initiate a request:

    1. Request Type: POST
    2. URI: (api-URL)/stream/enrich
    3. Content-type: application/json
    4. Security Header Param:
      orcas-token: TOKEN
      
    5. Request Body:
      {
        "kind": "EnrichmentCache",
        "apiVersion": "fitness.orcasio.com/v1alpha3",
        "metadata": {
          "name": "some-record",
          "namespace": "<tenant_ID>"
        },
        "spec": {
          "domain": "domain-name",
          "datatype": "json",
          "time": "2023-06-18T10:00:00Z",
          "json": {
            "data": [
              {
                "name": "john d",
                "user_id": "123",
                "director": {
                  "name": "jane d",
                  "fullname": "jane dean",
                  "city": "anytown"
                }
              }
            ]
          }
        }
      }
      
    6. Response (success): Status code 200
    7. Response (failure): Status code 400

Once the data is uploaded it will be stored and available for the Fitness Engine to enrich the Fitness Score.

Warning

When deleting an Enrichment Domain from the cluster, all the uploaded data to that domain will be eliminated