Skip to content

Conversation

@bctiemann
Copy link
Contributor

@bctiemann bctiemann commented Nov 26, 2025

Closes: #282

Enables configuration of a max_custom_object_types setting:

PLUGINS_CONFIG = {
    'netbox_custom_objects': {
        'max_custom_object_types': 1000,
    }
}

Attempting to create more than this number of Custom Object Types will raise a ValidationError (this is done via clean at the model level, so this will work the same via the UI or API).

@bctiemann bctiemann requested a review from arthanson November 26, 2025 11:28
@@ -0,0 +1,7 @@
# Configuration Parameters

## `max_cots`
Copy link
Contributor

Choose a reason for hiding this comment

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

I would consider renaming this to e.g. max_object_types to be a bit more clear to the user. I'm not sure how well-understood the COT acronym is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed; I was erring on the side of the terminology suggested by the FR, but this is better in any case..

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed

@bctiemann bctiemann changed the title Closes: #282 - Add handling for max_cots config option (and configuration.md) Closes: #282 - Add handling for max_custom_object_types config option (and configuration.md) Nov 26, 2025
Copy link
Contributor

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

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

I would add max_custom_object_types to default_settings in the AppConfig as well, as a supplementary means of documentation.

We might also want to set a default limit (e.g. 100) for sanity.

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.

Introduce MAX_COTS configuration paramater to limit number of Custom Object Types

4 participants