Skip to content

Enhance Inventory App: Add Support to Manage and Assign Global SNMP Settings#53

Merged
PaulWinterstein merged 4 commits into
mainfrom
52-add-support-for-snmp-global-setting-assignment-by-label-in-inventory-app
Jul 2, 2025
Merged

Enhance Inventory App: Add Support to Manage and Assign Global SNMP Settings#53
PaulWinterstein merged 4 commits into
mainfrom
52-add-support-for-snmp-global-setting-assignment-by-label-in-inventory-app

Conversation

@PaulWinterstein

@PaulWinterstein PaulWinterstein commented Jun 25, 2025

Copy link
Copy Markdown
Collaborator

Resolves #52

Summary

Adds support for managing global SNMP configurations in the Inventory App, including:

  • CRUD operations for global SNMP settings
  • Label-based lookup and assignment helpers
  • Integration into the device configuration model (ID + activation flag)

This enables assigning reusable SNMP configurations to devices in a lightweight and consistent way.

Example: Assign SNMP config to a device by label

Assuming a global SNMP configuration named "SNMP Config for eMerge" has already been created via the Inventory App GUI:

label = "SNMP Config for eMerge"
snmp_setting_id = app.inventory.get_global_snmp_config_id_by_label(label)
device_config.set_global_snmp_setting(snmp_setting_id)

Optional: store the reference only (without activating it yet):

device_config.set_global_snmp_setting(snmp_setting_id, activate=False)

To verify assigned config:

device_config.get_global_snmp_setting_id()
# > ab949038-9dc4-4fc7-af4f-cba04584e686

snmp_setting_label = app.inventory.get_global_snmp_config_label_by_id("ab949038-9dc4-4fc7-af4f-cba04584e686")
print(snmp_setting_label)
# > SNMP Config for eMerge

@PaulWinterstein PaulWinterstein linked an issue Jun 25, 2025 that may be closed by this pull request
…operations), SNMP config Pydantic Model, uuid validation and test
… global SNMP model, and getter/setter in InventoryDevice for global SNMP config
@PaulWinterstein PaulWinterstein changed the title Add global SNMP configuration helper methods Enhance Inventory App: Add Support to Manage and Assign Global SNMP Settings Jun 29, 2025
@PaulWinterstein PaulWinterstein marked this pull request as ready for review June 29, 2025 11:36
@PaulWinterstein PaulWinterstein marked this pull request as draft June 29, 2025 11:37
@PaulWinterstein PaulWinterstein marked this pull request as ready for review June 29, 2025 11:37

@JonasScholl JonasScholl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍 Even with some tests, nice :D

@PaulWinterstein PaulWinterstein merged commit 36b9c39 into main Jul 2, 2025
7 checks passed
@PaulWinterstein PaulWinterstein deleted the 52-add-support-for-snmp-global-setting-assignment-by-label-in-inventory-app branch July 2, 2025 09:54
@PaulWinterstein PaulWinterstein self-assigned this May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance Inventory App: Manage and Assign Global SNMP Settings

2 participants