From DataFlowEvent.schema.yaml (jarvis/DataFlowEvent.schema
)
---
$id: https://skeleton.botmd.io/jarvis/DataFlowEvent.schema
$schema: http://json-schema.org/draft-07/schema#
title: Data Flow Event
description: >-
This schema describes data events for Jarvis modules.
anyOf:
- $ref: "#/definitions/Provider Sync"
- $ref: "#/definitions/Provider CUD"
- $ref: "#/definitions/Module CUD"
- $ref: "#/definitions/Elasticsearch Index Ops"
#end oneOf
definitions:
Provider Sync:
title: Provider Sync
description: "Provider sync event happens when `sync_modules` is executed against a module with `Provider`."
type: object
additionalProperties: false
required: [provider]
properties:
provider:
title: Provider Key
description: The unique provider `key` at time of the event.
type: string
minLength: 1
#end provider
syncer_kwargs:
title: Syncer Arguments
description: The value of `syncer_kwargs` for provider syncing.
type: object
$ref: "/skeleton/Any.schema"
#end syncer_kwargs
#end properties
#end Provider Sync
Provider CUD:
title: Provider CUD
description: "Provider CUD event happens when a `Provider` model is created, updated, or deleted. This is implemented via django signals."
type: object
additionalProperties: false
required: [provider, operation]
properties:
provider:
title: Provider Key
description: The unique provider `key` at time of the event.
type: string
minLength: 1
#end provider
operation:
title: Operation
description: Whether it is a `create`, `update`, or `delete`.
type: string
enum: [create, update, delete]
#end operation
value:
title: Value
description: The value of the Provider after the event. For delete events, this will be the final value of the provider before deletion.
type: object
$ref: "/skeleton/Any.schema"
#end value
#end properties
#end Provider CUD
Module CUD:
title: Module CUD
description: "Module CUD event happens when a `Module` is created, updated, or deleted. This is implemented via django signals."
type: object
additionalProperties: false
required: [operation, value]
properties:
operation:
title: Operation
description: Whether it is a `create`, `update`, or `delete`.
type: string
enum: [create, update, delete]
#end operation
value:
title: Value
description: The value of the Module model after the event. For delete events, this will be the final value of the module before deletion.
type: object
$ref: "/skeleton/Any.schema"
#end value
#end properties
#end Module CUD
Elasticsearch Index Ops:
title: Elasticsearch Index Ops
description: "Elasticsearch Index Ops event happens when a write operation is performed via the `elasticsearch_indices` management command."
type: object
additionalProperties: false
required: [operation]
properties:
operation:
title: Operation
description: Whether it is a `create`, `set`, `prune`, or `reindex`.
type: string
enum: [create, set, prune, reindex]
#end operation
old_index:
title: Old Index
description: Name of old index replaced as a result of `set` operations.
type: string
minLength: 1
#end old_index
new_index:
title: New Index
description: Name of new index created as a result of `create`, `set`, and `reindex` operations.
type: string
minLength: 1
#end new_index
source_index:
title: Source Index
description: Name of source index where we `reindex` from.
type: string
minLength: 1
#end source_index
deleted_indices:
title: Deleted Indices
description: Array of indices deleted in the `prune` operation
type: array
minItems: 1
items:
type: string
minLength: 1
#end deleted_indices
response:
title: Raw Response
description: Raw response from Elasticsearch.
type: object
$ref: "/skeleton/Any.schema"
#end response
#end properties
#end Elasticsearch Index Ops
#end definitions