diff --git a/extensions/eda/plugins/event_source/range_input_schema.json b/extensions/eda/plugins/event_source/range_input_schema.json deleted file mode 100644 index 45fe7929..00000000 --- a/extensions/eda/plugins/event_source/range_input_schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://redhat.com/ansible_events/sources/range_input_schema.json", - "title": "Input of range Plugin", - "description": "A simple plugin to generate integer values given a limit", - "type": "object", - "properties": { - "limit": { - "description": "The max integer value", - "type": "integer" - } - }, - "required": ["limit"] -} diff --git a/extensions/eda/plugins/event_source/range_output_schema.json b/extensions/eda/plugins/event_source/range_output_schema.json deleted file mode 100644 index d6a60898..00000000 --- a/extensions/eda/plugins/event_source/range_output_schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://redhat.com/ansible_events/sources/range_output_schema.json", - "title": "Output of range Plugin", - "description": "A simple plugin to generate integer values given a limit", - "type": "object", - "properties": { - "i": { - "description": "The current integer value", - "type": "integer" - } - }, - "required": ["i"] -} diff --git a/extensions/eda/plugins/event_source/schemas/alertmanager.json b/extensions/eda/plugins/event_source/schemas/alertmanager.json new file mode 100644 index 00000000..68515090 --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/alertmanager.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/alertmanager.json", + "title": "Alert manager Source Plugin", + "description": "A plugin for Alert Manager", + "type": "object", + "properties": { + "host": { + "description": "The webserver hostname to listen to. Set to 0.0.0.0 to listen on all interfaces. Defaults to 127.0.0.1", + "title": "Host", + "type": "string", + "default": "127.0.0.1" + }, + "port": { + "description": "The TCP port to listen to. Defaults to 5000", + "title": "Port", + "type": "integer", + "default": 5000 + }, + "data_alerts_path": { + "description": "The json path to find alert data. Default to alerts Use empty string to treat the whole payload data as one alert.", + "title": "Alerts Path", + "type": "string", + "default": "alerts" + }, + "data_host_path": { + "description": "The json path inside the alert data to find alerting host. Use empty string if there is no need to find host. Default to labels.instance.", + "title": "Host Path", + "type": "string", + "default": "labels.instance" + }, + "data_path_separator": { + "description": "The separator to interpret data_host_path and data_alerts_path. Default is . (dot or period)", + "title": "Path Separator", + "type": "string", + "default": "." + }, + "skip_original_data": { + "description": "If enabled only the alert data will be put in queue, else put sequentially both the received original data and each parsed alert item to the queue.", + "title": "Skip Original Data", + "type": "boolean", + "default": false + } + }, + "required": [ + "host", + "port" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/aws_cloudtrail.json b/extensions/eda/plugins/event_source/schemas/aws_cloudtrail.json new file mode 100644 index 00000000..d356abad --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/aws_cloudtrail.json @@ -0,0 +1,81 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/aws_cloudtrail.json", + "title": "Source Plugin for AWS CloudTrail", + "description": "An ansible-rulebook event source module for getting events from an AWS CloudTrail", + "type": "object", + "properties": { + "access_key": { + "description": "AWS access key ID", + "title": "Access Key", + "type": "string", + "format": "password" + }, + "secret_key": { + "description": "AWS secret key", + "title": "Secret Key", + "type": "string", + "format": "password" + }, + "session_token": { + "description": "STS session token for use with temporary credentials", + "title": "Session Token", + "type": "string", + "format": "password" + }, + "endpoint_url": { + "description": "URL to connect to instead of the default AWS endpoints", + "title": "Endpoint URL", + "type": "string" + }, + "region": { + "description": "AWS region to use", + "title": "Region", + "type": "string" + }, + "delay_seconds": { + "description": "The number of seconds to wait between polling", + "title": "Poll Delay", + "type": "integer", + "default": 10 + }, + "lookup_attributes": { + "description": "Lookup attributes", + "title": "Filters", + "type": "array", + "items": { + "$ref": "#/$defs/lookup" + } + }, + "event_category": { + "description": "Event Category", + "title": "Event Category", + "type": "string" + } + }, + "$defs": { + "lookup": { + "type": "object", + "required": [ + "AttributeKey", + "AttributeValue" + ], + "properties": { + "AttributeKey": { + "type": "string", + "title": "Key", + "description": "Specifies an attribute on which to filter the events" + }, + "AttributeValue": { + "type": "string", + "title": "Value", + "description": "Specifies a value for the specified AttributeKey" + } + } + } + }, + "required": [ + "lookup_attributes", + "event_category" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/aws_sqs_queue.json b/extensions/eda/plugins/event_source/schemas/aws_sqs_queue.json new file mode 100644 index 00000000..3b2d0f3c --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/aws_sqs_queue.json @@ -0,0 +1,51 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/aws_sqs_queue.json", + "title": "Source Plugin for AWS SQS Queue", + "description": "An ansible-rulebook event source plugin for receiving events via an AWS SQS queue.", + "type": "object", + "properties": { + "access_key": { + "description": "AWS access key ID", + "type": "string", + "title": "Access Key", + "format": "password" + }, + "secret_key": { + "description": "AWS secret key", + "type": "string", + "title": "Secret Key", + "format": "password" + }, + "session_token": { + "description": "STS session token for use with temporary credentials", + "title": "Session Token", + "type": "string", + "format": "password" + }, + "endpoint_url": { + "description": "URL to connect to instead of the default AWS endpoints", + "type": "string", + "title": "End Point URL" + }, + "region": { + "description": "AWS region to use", + "type": "string", + "title": "Region" + }, + "name": { + "description": "The name of the queue", + "type": "string", + "title": "Queue Name" + }, + "delay_seconds": { + "description": "The SQS long polling duration. Set to 0 to disable", + "title": "Polling Interval", + "type": "integer", + "default": 2 + } + }, + "required": [ + "name" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/azure_service_bus.json b/extensions/eda/plugins/event_source/schemas/azure_service_bus.json new file mode 100644 index 00000000..80dabc84 --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/azure_service_bus.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/azure_service_bus.json", + "title": "Azure Service Bus plugin for EDA", + "description": "An ansible-rulebook event source module for receiving events from an Azure service bus", + "type": "object", + "properties": { + "conn_str": { + "description": "The connection string", + "type": "string", + "title": "Connection String" + }, + "queue_name": { + "description": "The queue name", + "type": "string", + "title": "Queue Name" + }, + "logging_enable": { + "description": "Turn on logging", + "type": "boolean", + "default": true, + "title": "Enable Logging" + } + }, + "required": [ + "conn_str", + "queue_name" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/file.json b/extensions/eda/plugins/event_source/schemas/file.json new file mode 100644 index 00000000..ebe0e6c8 --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/file.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/file.json", + "title": "YAML File monitor plugin for EDA", + "description": "An ansible-rulebook event source plugin for loading facts from YAML files initially and when the file changes.", + "type": "object", + "properties": { + "files": { + "description": "An array of YAML files to monitor", + "title": "YAML Files", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "files" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/file_watch.json b/extensions/eda/plugins/event_source/schemas/file_watch.json new file mode 100644 index 00000000..3d5c5c1b --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/file_watch.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/file_watch.json", + "title": "File Watcher Source plugin", + "description": "An ansible-rulebook event source plugin for watching file system changes.", + "type": "object", + "properties": { + "path": { + "description": "The directory to watch for changes.", + "type": "string", + "title": "Path" + }, + "recursive": { + "description": "Recursively watch the path if true", + "type": "boolean", + "title": "Recursive" + }, + "ignore_regexes": { + "description": "A list of regular expressions to ignore changes", + "title": "Ignore Regexes", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "path", + "recursive" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/generic.json b/extensions/eda/plugins/event_source/schemas/generic.json new file mode 100644 index 00000000..584474cd --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/generic.json @@ -0,0 +1,112 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/generic.json", + "title": "A generic event generator plugin", + "description": "A generic source plugin that allows you to insert custom data.", + "type": "object", + "properties": { + "payload": { + "description": "An array of event payloads", + "title": "Payload", + "type": "array", + "items": { + "$ref": "#/$defs/generic_payload" + } + }, + "randomize": { + "description": "Randomize the events in the payload", + "title": "Randomize", + "type": "boolean", + "default": false + }, + "display": { + "description": "Display the event data in stdout", + "title": "Display", + "type": "boolean", + "default": false + }, + "timestamp": { + "title": "Time Stamp", + "description": "Add an event timestamp, to every event", + "type": "boolean", + "default": false + }, + "time_format": { + "title": "Time Format", + "description": "The time format of event timestamp", + "enum": [ + "local", + "epoch", + "iso8601" + ], + "default": "local" + }, + "create_index": { + "title": "Index Key", + "description": "The index to create for each event starts at 0", + "type": "string" + }, + "startup_delay": { + "title": "Startup Delay", + "description": "Number of seconds to wait before injecting events", + "type": "number", + "default": 0 + }, + "event_delay": { + "title": "Event Delay", + "description": "Number of seconds to wait before injecting the next event from the payload.", + "type": "number", + "default": 0 + }, + "repeat_delay": { + "title": "Repeat Delay", + "description": "Number of seconds to wait before injecting a repeated event from the payload", + "type": "number", + "default": 0 + }, + "loop_delay": { + "title": "Loop Delay", + "description": "Number of seconds to wait before inserting the next set of events.", + "type": "number", + "default": 0 + }, + "shutdown_after": { + "title": "Shutdown After", + "description": "Number of seconds to wait before shutting down the plugin", + "type": "number", + "default": 0 + }, + "loop_count": { + "title": "Loop Count", + "description": "Number of times the set of events in the payload should be repeated, -1 loops for ever", + "type": "integer", + "default": 1 + }, + "repeat_count": { + "title": "Repeat Count", + "description": "Number of times each individual event in the payload should be repeated", + "type": "integer", + "default": 1 + }, + "blob_size": { + "title": "Blob Size", + "description": "An arbitrary blob of blob_size bytes to be inserted into every event payload.", + "type": "integer", + "default": 0 + }, + "final_payload": { + "title": "Final Payload", + "description": "After all the events have been sent we send the optional final payload which can be used to trigger a shutdown of the rulebook, especially when we are using rulebooks to forward messages to other running rulebooks.", + "$ref": "#/$defs/generic_payload" + } + }, + "$defs": { + "generic_payload": { + "type": "object", + "additional_properties": "true" + } + }, + "required": [ + "payload" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/journald.json b/extensions/eda/plugins/event_source/schemas/journald.json new file mode 100644 index 00000000..ac068a40 --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/journald.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/journald.json", + "title": "A journald source plugin", + "description": "An ansible-events event source plugin that tails systemd journald logs.", + "type": "object", + "properties": { + "match": { + "description": "Events that matches, see see https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html ALL matches all events", + "title": "Match", + "type": "string", + "examples": [ + "PRIORITY=6", + "_EXE=/usr/bin/sudo", + "ALL" + ] + } + }, + "required": [ + "match" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/kafka.json b/extensions/eda/plugins/event_source/schemas/kafka.json new file mode 100644 index 00000000..470d7961 --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/kafka.json @@ -0,0 +1,127 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/kafka.json", + "title": "Kafka Source Plugin", + "description": "An ansible-rulebook event source plugin for receiving events via a kafka topic.", + "type": "object", + "properties": { + "port": { + "description": "The port where the kafka server is listening", + "type": "integer", + "title": "Port" + }, + "host": { + "description": "The host where the kafka topic is hosted", + "type": "string", + "title": "Host" + }, + "cafile": { + "description": "Certificate authority file path containing certificates used to sign kafka broker certificates", + "type": "string", + "title": "Certificate Authority File", + "default": "" + }, + "certfile": { + "description": "The optional client certificate file path containing the client certificate, as well as CA certificates needed to establish the certificate's authenticity", + "type": "string", + "title": "Certificate File", + "default": "" + }, + "keyfile": { + "description": "The optional client key file path containing the client private key", + "type": "string", + "title": "Key File", + "default": "" + }, + "password": { + "description": "The optional password to be used when loading the certificate chain", + "type": "string", + "title": "Password", + "format": "password" + }, + "check_hostname": { + "description": "Enable SSL hostname verification", + "type": "boolean", + "title": "Check Hostname", + "default": true + }, + "verify_mode": { + "description": "Whether to try to verify other peers' certificates and how to behave if verification fails.", + "enum": [ + "CERT_NONE", + "CERT_OPTIONAL", + "CERT_REQUIRED" + ], + "title": "Verify Mode", + "default": "CERT_REQUIRED", + "type": "string" + }, + "encoding": { + "description": "Message encoding scheme", + "title": "Encoding", + "default": "utf-8", + "type": "string" + }, + "topic": { + "description": "The Kafka topic", + "type": "string", + "title": "Kafka Topic" + }, + "group_id": { + "description": "A Kafka group id", + "type": "string", + "title": "Kafka Group ID" + }, + "offset": { + "description": "Where to start reading messages from", + "type": "string", + "title": "Offset", + "enum": [ + "latest", + "earliest" + ], + "default": "latest" + }, + "security_protocol": { + "description": "Protocol used to communicate with brokers.", + "type": "string", + "enum": [ + "PLAINTEXT", + "SSL", + "SASL_PLAINTEXT", + "SASL_SSL" + ], + "title": "Security Protocol", + "default": "PLAINTEXT" + }, + "sasl_mechanism": { + "description": "Authentication mechanism when security_protocol is configured.", + "type": "string", + "enum": [ + "PLAIN", + "GSSAPI", + "SCRAM-SHA-256", + "SCRAM-SHA-512", + "OAUTHBEARER" + ], + "title": "SASL Mechanism", + "default": "PLAIN" + }, + "sasl_plain_username": { + "title": "SASL Plain Username", + "description": "Username for SASL PLAIN authentication", + "type": "string" + }, + "sasl_plain_password": { + "title": "SASL Plain Password", + "description": "Password for SASL PLAIN authentication", + "type": "string", + "format": "password" + } + }, + "required": [ + "host", + "port", + "topic" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/pg_listener.json b/extensions/eda/plugins/event_source/schemas/pg_listener.json new file mode 100644 index 00000000..caef410e --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/pg_listener.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/pg_listener.json", + "title": "Postgres Listener Source Plugin", + "description": "An event source plugin for reading events from Postgres Notify/Listen", + "type": "object", + "properties": { + "dsn": { + "description": "The connection string Data Source Name", + "type": "string", + "title": "Data Source Name" + }, + "channels": { + "description": "The channels to listen on", + "title": "Channels", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "dsn", + "channels" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/range.json b/extensions/eda/plugins/event_source/schemas/range.json new file mode 100644 index 00000000..5f70e90d --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/range.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/range.json", + "title": "Event Source Range Plugin", + "description": "A simple plugin to generate integer values given a limit", + "type": "object", + "properties": { + "limit": { + "description": "The max integer value", + "title": "Limit", + "type": "integer" + }, + "delay": { + "description": "The number of seconds to wait between events", + "title": "Delay", + "type": "integer" + } + }, + "required": [ + "limit" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/url_check.json b/extensions/eda/plugins/event_source/schemas/url_check.json new file mode 100644 index 00000000..6ea57064 --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/url_check.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/url_check.json", + "title": "URL Checker source plugin", + "description": "An ansible-rulebook event source plugin that polls a set of URLs and sends events with their status.", + "type": "object", + "properties": { + "urls": { + "description": "A list of URL's to poll", + "title": "URLs", + "type": "array", + "items": { + "type": "string" + } + }, + "delay": { + "description": "Number of seconds to wait between polling", + "title": "Delay", + "type": "integer", + "default": 1 + }, + "verify_ssl": { + "description": "Verify SSL Certificate", + "title": "Verify Server Certificate", + "type": "boolean", + "default": true + } + }, + "required": [ + "urls" + ] +} diff --git a/extensions/eda/plugins/event_source/schemas/webhook.json b/extensions/eda/plugins/event_source/schemas/webhook.json new file mode 100644 index 00000000..a34d2a2a --- /dev/null +++ b/extensions/eda/plugins/event_source/schemas/webhook.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://redhat.com/ansible_events/sources/webhook.json", + "title": "Webhook Source Plugin", + "description": "Webhook plugins can receive events from external servers", + "type": "object", + "properties": { + "port": { + "description": "The port number to listen for incoming events", + "type": "integer", + "title": "Port" + }, + "host": { + "description": "The host address to listen on, default is 0.0.0.0", + "type": "string", + "title": "Host", + "default": "0.0.0.0" + }, + "token": { + "description": "Authentication token in header", + "type": "string", + "title": "Authentication Token", + "default": "" + }, + "certfile": { + "description": "The certfile to use", + "type": "string", + "title": "Certificate File", + "default": "" + }, + "keyfile": { + "description": "The keyfile to use", + "type": "string", + "title": "Key File", + "default": "" + }, + "password": { + "description": "The password to use", + "type": "string", + "title": "Password", + "default": "" + }, + "hmac_secret": { + "description": "The HMAC Secret to use", + "type": "string", + "title": "HMAC Secret", + "default": "" + }, + "hmac_algo": { + "description": "The HMAC Algorithm to use", + "type": "string", + "title": "HMAC Algorithm", + "default": "sha256" + }, + "hmac_header": { + "description": "The HTTP header which will contain the payload signature", + "type": "string", + "title": "HMAC Header", + "default": "x-hub-signature-256" + }, + "hmac_format": { + "description": "The format of the payload signature, hex or base64", + "type": "string", + "enum": [ + "hex", + "base64" + ], + "title": "HMAC Format", + "default": "hex" + } + }, + "required": [ + "port" + ] +}