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

Add support for DeviceType components #742

Merged

Conversation

kr3ator
Copy link
Contributor

@kr3ator kr3ator commented Apr 8, 2022

Related Issue: n/a

New Behavior

This PR adds support for all of the DeviceType components like Interfaces, DeviceBays, etc. to the 190_device_type startup script.

Contrast to Current Behavior

Currently there is no support for DeviceType components and there is only startup script that is available to create actual instances of these components is for interfaces.

Discussion: Benefits and Drawbacks

This is backwards compatible. If a user wants to use this feature he only needs to extend his current device_type.yml (examples therein).
Templates are supported just as when adding a component through the UI. Fields that support templating need to be suffixed with _template, e.g. name_template. If by mistake name and name_template keys are provided then the normal field takes precedence.

This PR assumes that #729 is merged.

Changes to the Wiki

n/a

Proposed Release Note Entry

Feature: Add support for device component templates to DeviceType startup script.

Double Check

  • I have read the comments and followed the PR template.
  • I have explained my PR according to the information in the comments.
  • My PR targets the develop branch.

@kr3ator kr3ator mentioned this pull request Apr 8, 2022
3 tasks
@kr3ator kr3ator force-pushed the feature/device_type_components branch 2 times, most recently from 5eecfc6 to cdd9d54 Compare April 8, 2022 11:14
@kr3ator
Copy link
Contributor Author

kr3ator commented Apr 8, 2022

This PR assumes that #729 is merged, until then the build pipelines will fail.

@cimnine cimnine added the enhancement The issue describes an enhancement that we would like to implement in the future. label Apr 8, 2022
Copy link
Collaborator

@cimnine cimnine left a comment

Choose a reason for hiding this comment

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

Thank you for this PR. Just one tiny remark:

Since the examples are mostly our reference documentation, I believe it would be great to have one entry where the following is true and then a comment explaining that the non-template field takes presedence.

… if by mistake name and name_template keys are provided then the normal field takes precedence.

@kr3ator kr3ator requested a review from cimnine April 8, 2022 13:11
Copy link
Collaborator

@cimnine cimnine left a comment

Choose a reason for hiding this comment

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

Thanks

@kr3ator kr3ator force-pushed the feature/device_type_components branch from 1df9b36 to 12753dd Compare April 8, 2022 13:58
@kr3ator
Copy link
Contributor Author

kr3ator commented Apr 12, 2022

@tobiasge are we good to merge this and my other 2 PRs ?

@kr3ator kr3ator force-pushed the feature/device_type_components branch from a1ecfce to 12753dd Compare April 12, 2022 10:09
@tobiasge tobiasge merged commit 2c757af into netbox-community:develop Apr 12, 2022
@kr3ator kr3ator deleted the feature/device_type_components branch April 12, 2022 11:42
@tobiasge tobiasge mentioned this pull request Jul 12, 2022
@atos-tomasz-fabisiak atos-tomasz-fabisiak mentioned this pull request Aug 9, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue describes an enhancement that we would like to implement in the future.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants