avd icon indicating copy to clipboard operation
avd copied to clipboard

Feat(eos_cli_config_gen): add event-handler trigger "on-maintenance"

Open kmueller68 opened this issue 1 year ago • 1 comments

Enhancement summary

Added the option for creating event-handler with trigger on-maintenance.

There are two main sub-options enter and exit, but many further options afterwards.

QUAL__leaf-1a2-01(config-handler-ON-MAINTENANCE-EXIT)#trigger on-maintenance ?
  enter  Trigger condition occurs on-maintenance enter operation
  exit   Trigger condition occurs on-maintenance exit operation

QUAL__leaf-1a2-01(config-handler-ON-MAINTENANCE-EXIT)#trigger on-maintenance enter ?
  bgp        Trigger condition occurs on maintenance operation of specified BGP peer
  interface  Trigger condition occurs on maintenance operation of specified interface
  unit       Trigger condition occurs on maintenance operation of specified unit

QUAL__leaf-1a2-01(config-handler-ON-MAINTENANCE-EXIT)#trigger on-maintenance enter unit ?
  WORD  name of the unit

QUAL__leaf-1a2-01(config-handler-ON-MAINTENANCE-EXIT)#trigger on-maintenance enter unit System ?
  after   Action is triggered after specified stage
  all     Action is triggered at all stages of maintenance operation
  before  Action is triggered before specified stage
  begin   Action is triggered at the begining of maintenance operation
  end     Action is triggered at the end of maintenance operation

Which component of AVD is impacted

eos_cli_config_gen

Use case example

  ON-MAINTENANCE-EXIT:
    action_type: bash
    action: "FastCli -p 15 -c downlink-nomaint; FastCli -p 15 -c peerlink-nomaint; EOF"
    trigger: on-maintenance exit unit System begin
    asynchronous: true
event-handler ON-MAINTENANCE-EXIT
   trigger on-maintenance exit unit System begin
   action bash FastCli -p 15 -c downlink-nomaint; FastCli -p 15 -c peerlink-nomaint; EOF
   asynchronous

Describe the solution you would like

As the definition and configuration already works, it looks like only an update is needed to the schema. The templates already render the complete string correctly.

for example: on-maintenance exit unit System begin

Would it be possible to add "on-maintenance enter" and "on-maintenance exit" trigger options to the schema files only, with a kind of wildcard afterwards to match all following different possible values.

Describe alternatives you have considered

No response

Additional context

No response

Contributing Guide

  • [X] I agree to follow this project's Code of Conduct

kmueller68 avatar Jun 02 '23 15:06 kmueller68

This issue is stale because it has been open 90 days with no activity. The issue will be reviewed by a maintainer and may be closed

github-actions[bot] avatar Sep 01 '23 00:09 github-actions[bot]