Skip to content

Enrichment

mrblacyk edited this page Apr 24, 2020 · 2 revisions

Enrichment

JSON structure

{
    "data_needed": ["Data Needed #0001"],
    "data_to_enrich": ["Data Needed #0003"],
    "requirements": ["Enrichment #0002"],
    "references": ["https://google.com/"],
    "new_fields": [],
    "title": "Enrichment #0002",
    "description": "This enriches everything!",
    "author": "atc-project",
    "config": "Here is the config example:\n\n  ```\n  code\n  ```\n"
}

ATC Enrichment yaml file

title: Enrichment #0002
description: >
  This enriches everything!
data_needed:
  - Data Needed #0001
data_to_enrich:
  - Data Needed #0003
references:
  - https://www.google.com/
requirements:
  - Enrichment #0001
new_fields:
  - ParentUser
  - ParentIntegrityLevel
author: atc-project
config: |
  Here is the config example:

  ``
  code
  ``

Python snippet for inserting data

path_to_en = "EN0002.yml"

with open(path_to_en, 'r') as stream:
    en = yaml.safe_load(stream)

r = requests.post(
    'http://127.0.0.1:8000/api/v1/atc/enrichment/',
    json=en,
    auth=('admin', 'admin')
)

Filters

There are two types of filters - exact match and contains. Here is the list of valid filters:

Contains

  • title_contains
  • data_needed_contains
  • data_to_enrich_contains
  • requirements_contains
  • new_fields_contains

Exact

  • title_exact
  • data_needed_exact
  • data_to_enrich_exact
  • requirements_exact
  • new_fields_exact
Clone this wiki locally