Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(eos_cli_config_gen): Add event-handler trigger on-maintenance. #3629

Merged
merged 11 commits into from
Apr 15, 2024

Conversation

Shivani-gslab
Copy link
Contributor

@Shivani-gslab Shivani-gslab commented Feb 16, 2024

Change Summary

Add event-handler trigger "on-maintenance".

Related Issue(s)

Fixes #2951

Component(s) name

arista.avd.eos_cli_config_gen

Proposed changes

Adding an option for "on-maintenance" in event-handlers.trigger and updated the data-model for the same.

How to test

Add input trigger on-maintenance:

- name: trigger-on-maintenance
    trigger: on-maintenance
    trigger_on_maintenance:
      operation: enter
      interface:
        interface_type: Ethernet
        interface_number: 4
      stage: all
    action_type: bash
    action: echo "on-maintenance"

Check the output config:

!
event-handler trigger-on-maintenance
   trigger on-maintenance enter interface Ethernet 4 all
   action bash echo "on-maintenance"

Test the config on EOS CLI

Checklist

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@github-actions github-actions bot added role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated role: eos_designs issue related to eos_designs role labels Feb 16, 2024
@Shivani-gslab Shivani-gslab force-pushed the #issue2951 branch 2 times, most recently from 77f79b6 to cab7bba Compare February 16, 2024 09:29
@Shivani-gslab Shivani-gslab marked this pull request as ready for review February 16, 2024 09:48
@Shivani-gslab Shivani-gslab requested review from a team as code owners February 16, 2024 09:48
@Shivani-gslab Shivani-gslab marked this pull request as draft March 8, 2024 06:17
@Shivani-gslab Shivani-gslab force-pushed the #issue2951 branch 3 times, most recently from 8e98358 to a78245b Compare March 21, 2024 07:51
@MaheshGSLAB MaheshGSLAB marked this pull request as ready for review March 21, 2024 11:57
Copy link
Contributor

@MaheshGSLAB MaheshGSLAB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT, tested on lab

@sugetha24 sugetha24 self-requested a review April 9, 2024 21:57
Copy link
Contributor

@sugetha24 sugetha24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@ClausHolbechArista ClausHolbechArista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@Shivani-gslab Shivani-gslab marked this pull request as draft April 11, 2024 07:46
@Shivani-gslab Shivani-gslab marked this pull request as ready for review April 12, 2024 06:52
@ClausHolbechArista ClausHolbechArista merged commit 64dcde2 into aristanetworks:devel Apr 15, 2024
40 checks passed
@kmueller68
Copy link
Contributor

@ClausHolbechArista Thank you very much for implementing this.

@Shivani-gslab Shivani-gslab deleted the #issue2951 branch April 16, 2024 05:13
@kmueller68
Copy link
Contributor

@ClausHolbechArista

I have tested this addition to the event-handlers but it does not fix my warnings

on-maintenancehas two important flavours:

  • on-maintenance enter
  • on-maintenance exit
TASK [arista.avd.eos_cli_config_gen : Generate eos intended configuration] *****************************************************************
[WARNING]: [KHM-REWE-DC2-LEAF-01A]: 'Validation Error: event_handlers[14].trigger': 'on-maintenance enter unit System begin' is not one of
['on-boot', 'on-counters', 'on-intf', 'on-logging', 'on-maintenance', 'on-startup-config', 'vm-tracer vm']
event_handlers:
  - name: ON-MAINTENANCE-ENTER
    action_type: bash
    action: "FastCli -p 15 -c downlink-maint; EOF"
    trigger: on-maintenance enter unit System begin
    asynchronous: true

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

@Shivani-gslab
Copy link
Contributor Author

Shivani-gslab commented May 8, 2024

@ClausHolbechArista

I have tested this addition to the event-handlers but it does not fix my warnings

on-maintenancehas two important flavours:

  • on-maintenance enter
  • on-maintenance exit
TASK [arista.avd.eos_cli_config_gen : Generate eos intended configuration] *****************************************************************
[WARNING]: [KHM-REWE-DC2-LEAF-01A]: 'Validation Error: event_handlers[14].trigger': 'on-maintenance enter unit System begin' is not one of
['on-boot', 'on-counters', 'on-intf', 'on-logging', 'on-maintenance', 'on-startup-config', 'vm-tracer vm']
event_handlers:
  - name: ON-MAINTENANCE-ENTER
    action_type: bash
    action: "FastCli -p 15 -c downlink-maint; EOF"
    trigger: on-maintenance enter unit System begin
    asynchronous: true

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

Hi @kmueller68,

According to the data-model we have, you need to give the input in below format:

 - name: ON-MAINTENANCE-ENTER
    trigger: on-maintenance
    trigger_on_maintenance:
      operation: enter
      unit: System
      action: begin
    action_type: bash
    action: echo "on-maintenance"

@kmueller68
Copy link
Contributor

Hi @Shivani-gslab
Thank you very much for your super fast repsonse.
I missed the new data model for this.

I have tested it right now with the new model again and it is working well.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn: Feat(eos_cli_config_gen) role: eos_cli_config_gen issue related to eos_cli_config_gen role role: eos_designs issue related to eos_designs role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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