Skip to content

Commit

Permalink
Fixing Schema and molecule
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivani-gslab committed May 20, 2024
1 parent 182eb70 commit f823b60
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ event_handlers:
if [ 15 -gt 10 ]
then
echo "a is greater than 10"
fi
fi
increment_device_health_metric: Metric1
- name: trigger-on-maintenance1
trigger: on-maintenance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,10 @@ vmtracer session session_2

#### Event Handler Summary

| Handler | Action Type | Action | Trigger | Trigger Config |
| ------- | ----------- | ------ | ------- | -------------- |
| CONFIG_VERSIONING | bash | <code>FN=/mnt/flash/startup-config; LFN="`ls -1 $FN.*-* \| tail -n 1`"; if [ -z "$LFN" -o -n "`diff -I 'last modified' $FN $LFN`" ]; then cp $FN $FN.`date +%Y%m%d-%H%M%S`; ls -1r $FN.*-* \| tail -n +11 \| xargs -I % rm %; fi</code> | on-startup-config | - |
| evpn-blacklist-recovery | bash | <code>FastCli -p 15 -c "clear bgp evpn host-flap"</code> | on-logging | - |
| Handler | Actions | Trigger | Trigger Config |
| ------- | ------- | ------- | -------------- |
| CONFIG_VERSIONING | bash <code>FN=/mnt/flash/startup-config; LFN="`ls -1 $FN.*-* \| tail -n 1`"; if [ -z "$LFN" -o -n "`diff -I 'last modified' $FN $LFN`" ]; then cp $FN $FN.`date +%Y%m%d-%H%M%S`; ls -1r $FN.*-* \| tail -n +11 \| xargs -I % rm %; fi</code> | on-startup-config | - |
| evpn-blacklist-recovery | bash <code>FastCli -p 15 -c "clear bgp evpn host-flap"</code> | on-logging | - |

#### Event Handler Device Configuration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ vlan_internal_order:
ending: 1199
event_handlers:
- name: evpn-blacklist-recovery
action_type: bash
action: FastCli -p 15 -c "clear bgp evpn host-flap"
actions:
bash_command: FastCli -p 15 -c "clear bgp evpn host-flap"
delay: 300
trigger: on-logging
trigger_on_logging:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ vtep_vvtep_ip: 192.168.255.255/32
# Testing event_handlers
event_handlers:
- name: evpn-blacklist-recovery
action_type: bash
action: FastCli -p 15 -c "clear bgp evpn host-flap"
actions:
bash_command: FastCli -p 15 -c "clear bgp evpn host-flap"
delay: 300
trigger: on-logging
trigger_on_logging:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
| -------- | ---- | -------- | ------- | ------------------ | ----------- |
| [<samp>event_handlers</samp>](## "event_handlers") | List, items: Dictionary | | | | Gives the ability to monitor and react to Syslog messages.<br>Event Handlers provide a powerful and flexible tool that can be used to apply self-healing actions,<br>customize the system behavior, and implement workarounds to problems discovered in the field.<br> |
| [<samp>&nbsp;&nbsp;-&nbsp;name</samp>](## "event_handlers.[].name") | String | Required, Unique | | | Event Handler Name. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action_type</samp>](## "event_handlers.[].action_type") <span style="color:red">deprecated</span> | String | | | Valid Values:<br>- <code>bash</code><br>- <code>increment</code><br>- <code>log</code> | <span style="color:red">This key is deprecated. Support will be removed in AVD version 5.0.0. Use <samp>event_handler_action</samp> instead.</span> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action</samp>](## "event_handlers.[].action") <span style="color:red">deprecated</span> | String | | | | Command to execute.<br><span style="color:red">This key is deprecated. Support will be removed in AVD version 5.0.0. Use <samp>event_handler_action</samp> instead.</span> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action_type</samp>](## "event_handlers.[].action_type") <span style="color:red">deprecated</span> | String | | | Valid Values:<br>- <code>bash</code><br>- <code>increment</code><br>- <code>log</code> | <span style="color:red">This key is deprecated. Support will be removed in AVD version 5.0.0. Use <samp>event_handlers.actions</samp> instead.</span> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action</samp>](## "event_handlers.[].action") <span style="color:red">deprecated</span> | String | | | | Command to execute.<br><span style="color:red">This key is deprecated. Support will be removed in AVD version 5.0.0. Use <samp>event_handlers.actions</samp> instead.</span> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;actions</samp>](## "event_handlers.[].actions") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bash_command</samp>](## "event_handlers.[].actions.bash_command") | String | | | | Define BASH command action. Command could be multiline also. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;log</samp>](## "event_handlers.[].actions.log") | Boolean | | | | Log a message when the event is triggered. |
Expand Down Expand Up @@ -52,13 +52,13 @@
- name: <str; required; unique>
# This key is deprecated.
# Support will be removed in AVD version 5.0.0.
# Use <samp>event_handler_action</samp> instead.
# Use <samp>event_handlers.actions</samp> instead.
action_type: <str; "bash" | "increment" | "log">

# Command to execute.
# This key is deprecated.
# Support will be removed in AVD version 5.0.0.
# Use <samp>event_handler_action</samp> instead.
# Use <samp>event_handlers.actions</samp> instead.
action: <str>
actions:

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ keys:
warning: true
removed: false
remove_in_version: 5.0.0
new_key: event_handler_action
new_key: event_handlers.actions
action:
type: str
description: |
Expand All @@ -37,7 +37,7 @@ keys:
warning: true
removed: false
remove_in_version: 5.0.0
new_key: event_handler_action
new_key: event_handlers.actions
actions:
type: dict
keys:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
| Handler | Actions | Trigger | Trigger Config |
| ------- | ------- | ------- | -------------- |
{% for handler in event_handlers | arista.avd.natural_sort('name') %}
{% if handler.action_type is arista.avd.defined %}
{% set actions = handler.action_type %}
{% if handler.action is arista.avd.defined %}
{% set action = handler.action | replace('|', '\|') %}
{% set actions = actions ~ ' <code>' ~ action ~ '</code>' %}
{% endif %}
{% endif %}
{% if handler.actions is arista.avd.defined %}
{% set actions = [] %}
{% if handler.actions.bash_command is arista.avd.defined %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
| -------- | ---- | -------- | ------- | ------------------ | ----------- |
| [<samp>event_handlers</samp>](## "event_handlers") | List, items: Dictionary | | | | Gives the ability to monitor and react to Syslog messages.<br>Event Handlers provide a powerful and flexible tool that can be used to apply self-healing actions,<br>customize the system behavior, and implement workarounds to problems discovered in the field.<br> |
| [<samp>&nbsp;&nbsp;-&nbsp;name</samp>](## "event_handlers.[].name") | String | Required, Unique | | | Event Handler Name. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action_type</samp>](## "event_handlers.[].action_type") <span style="color:red">deprecated</span> | String | | | Valid Values:<br>- <code>bash</code><br>- <code>increment</code><br>- <code>log</code> | <span style="color:red">This key is deprecated. Support will be removed in AVD version 5.0.0. Use <samp>event_handler_action</samp> instead.</span> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action</samp>](## "event_handlers.[].action") <span style="color:red">deprecated</span> | String | | | | Command to execute.<br><span style="color:red">This key is deprecated. Support will be removed in AVD version 5.0.0. Use <samp>event_handler_action</samp> instead.</span> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action_type</samp>](## "event_handlers.[].action_type") <span style="color:red">deprecated</span> | String | | | Valid Values:<br>- <code>bash</code><br>- <code>increment</code><br>- <code>log</code> | <span style="color:red">This key is deprecated. Support will be removed in AVD version 5.0.0. Use <samp>event_handlers.actions</samp> instead.</span> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action</samp>](## "event_handlers.[].action") <span style="color:red">deprecated</span> | String | | | | Command to execute.<br><span style="color:red">This key is deprecated. Support will be removed in AVD version 5.0.0. Use <samp>event_handlers.actions</samp> instead.</span> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;actions</samp>](## "event_handlers.[].actions") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bash_command</samp>](## "event_handlers.[].actions.bash_command") | String | | | | Define BASH command action. Command could be multiline also. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;log</samp>](## "event_handlers.[].actions.log") | Boolean | | | | Log a message when the event is triggered. |
Expand Down Expand Up @@ -90,13 +90,13 @@
- name: <str; required; unique>
# This key is deprecated.
# Support will be removed in AVD version 5.0.0.
# Use <samp>event_handler_action</samp> instead.
# Use <samp>event_handlers.actions</samp> instead.
action_type: <str; "bash" | "increment" | "log">

# Command to execute.
# This key is deprecated.
# Support will be removed in AVD version 5.0.0.
# Use <samp>event_handler_action</samp> instead.
# Use <samp>event_handlers.actions</samp> instead.
action: <str>
actions:

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f823b60

Please sign in to comment.