Skip to content

Commit

Permalink
Feat(eos_cli_config_gen): Add other valid_values for event-handler tr…
Browse files Browse the repository at this point in the history
…igger 'on-boot' (#3264)
  • Loading branch information
gmuloc authored Oct 20, 2023
1 parent ad01a59 commit 1724d79
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface Management1
| ------- | ----------- | ------ | ------- |
| 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 |
| trigger-on-boot | bash | <code>echo "on-boot"</code> | on-boot |

#### Event Handler Device Configuration

Expand All @@ -61,4 +62,8 @@ event-handler evpn-blacklist-recovery
action bash FastCli -p 15 -c "clear bgp evpn host-flap"
delay 300
asynchronous
!
event-handler trigger-on-boot
trigger on-boot
action bash echo "on-boot"
```
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ event-handler evpn-blacklist-recovery
delay 300
asynchronous
!
event-handler trigger-on-boot
trigger on-boot
action bash echo "on-boot"
!
end
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ event_handlers:
action: 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
delay: 0
trigger: on-startup-config
- name: trigger-on-boot
trigger: on-boot
action_type: bash
action: echo "on-boot"
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action_type</samp>](## "event_handlers.[].action_type") | String | | | Valid Values:<br>- bash<br>- increment<br>- log | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action</samp>](## "event_handlers.[].action") | String | | | | Command to execute<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;delay</samp>](## "event_handlers.[].delay") | Integer | | | | Event-handler delay in seconds<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;trigger</samp>](## "event_handlers.[].trigger") | String | | | Valid Values:<br>- on-logging<br>- on-startup-config | Configure event trigger condition.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;trigger</samp>](## "event_handlers.[].trigger") | String | | | Valid Values:<br>- on-boot<br>- on-logging<br>- on-startup-config | Configure event trigger condition.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;regex</samp>](## "event_handlers.[].regex") | String | | | | Regular expression to use for searching log messages. Required for on-logging trigger<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;asynchronous</samp>](## "event_handlers.[].asynchronous") | Boolean | | `False` | | Set the action to be non-blocking. |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4224,6 +4224,7 @@
"type": "string",
"description": "Configure event trigger condition.\n",
"enum": [
"on-boot",
"on-logging",
"on-startup-config"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2524,6 +2524,7 @@ keys:
'
valid_values:
- on-boot
- on-logging
- on-startup-config
regex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ keys:
type: str
description: |
Configure event trigger condition.
valid_values: ["on-logging", "on-startup-config"]
valid_values:
- on-boot
- on-logging
- on-startup-config
regex:
type: str
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action_type</samp>](## "event_handlers.[].action_type") | String | | | Valid Values:<br>- bash<br>- increment<br>- log | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;action</samp>](## "event_handlers.[].action") | String | | | | Command to execute<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;delay</samp>](## "event_handlers.[].delay") | Integer | | | | Event-handler delay in seconds<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;trigger</samp>](## "event_handlers.[].trigger") | String | | | Valid Values:<br>- on-logging<br>- on-startup-config | Configure event trigger condition.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;trigger</samp>](## "event_handlers.[].trigger") | String | | | Valid Values:<br>- on-boot<br>- on-logging<br>- on-startup-config | Configure event trigger condition.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;regex</samp>](## "event_handlers.[].regex") | String | | | | Regular expression to use for searching log messages. Required for on-logging trigger<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;asynchronous</samp>](## "event_handlers.[].asynchronous") | Boolean | | `False` | | Set the action to be non-blocking. |
| [<samp>ipv6_mgmt_destination_networks</samp>](## "ipv6_mgmt_destination_networks") | List, items: String | | | | List of IPv6 prefixes to configure as static routes towards the OOB IPv6 Management interface gateway.<br>Replaces the default route.<br> |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,7 @@
"type": "string",
"description": "Configure event trigger condition.\n",
"enum": [
"on-boot",
"on-logging",
"on-startup-config"
],
Expand Down

0 comments on commit 1724d79

Please sign in to comment.