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):
Sample Enrichment Domain Configurations
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
-
Generate a new API Token for the Tenant
Refer to Pre-Requisites to generate the API Token
-
Upload data
Use a REST client (ex: Postman/ARC/cURL) to initiate a request:
- Request Type: POST
- URI: (api-URL)/stream/enrich
- Content-type: application/json
- Security Header Param:
- 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" } } ] } } } - Response (success): Status code 200
- 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