1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

25 Commits

Author SHA1 Message Date
Jeremy Stretch
46bd62fdc9 Merge branch 'develop' into feature 2024-04-22 13:23:42 -04:00
Arthur Hanson
b8cedfcc08 15582 check permissions on specific object when sync request (#15704)
* 15582 check permissions on specific object when sync request

* 15582 move permission check

* Enable translation of error message

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-04-17 10:09:50 -04:00
Jeremy Stretch
eaa3bc6576 Fixes #15570: Remove omission of M2M relations when generating writable serializers for OpenAPI schema 2024-03-28 16:17:12 -04:00
Jeremy Stretch
c382ba0ae0 Refactor REST API serializers to avoid circular imports 2024-02-27 13:26:43 -05:00
Jeremy Stretch
c146f5e1b5 Replace nested serializers with primary serializers where possible 2024-02-26 16:49:30 -05:00
Jeremy Stretch
d042e6f69d Closes #15238: Include description field in brief mode 2024-02-26 11:39:31 -05:00
Jeremy Stretch
3f3bcc5eb5 Closes #15235: Use primary serializers for REST API "brief" mode (#15246)
* Use primary serializers for brief mode

* Remove BriefModeMixin

* Correct ModuleBayTest brief_fields (see #15243)
2024-02-23 14:21:25 -05:00
Jeremy Stretch
3ddacf4b88 Merge branch 'develop' into feature 2024-02-21 16:24:23 -05:00
Abhimanyu Saharan
2e74952ac6 added missing import #15058 2024-02-16 01:20:54 +05:30
Jeremy Stretch
7abb2b2ab5 Closes #15131: Dynamic queryset annotations for REST API endpoints (#15152)
* Introduce RelatedObjectCountField

* Introduce get_annotations_for_serializer() and enable dynamic annotations

* Add RelatedObjectCountFields to serializers; remove static annotations from querysets

* Remove annotations cleanup logic from BriefModeMixin

* Annotate type for RelatedObjectCountField

* Remove redundant field on TagSerializer

* Add missing reverse relationship for power feeds to rack

* Refactor RelatedObjectCountField to take a single relationship name
2024-02-15 14:49:27 -05:00
Jeremy Stretch
b3f25a400b Closes #15087: Support for specifying a subset of API serializer fields (#15122)
* Enable dynamic field inclusion for REST API serializers

* Recurse through nested serializer when resolving prefetches

* Remove obsolete calls to prefetch_related() for API views

* Remove support for brief_prefetch_fields viewset attribute

* Rename query parameter

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode (#15134)

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode

* Update API test

* Restore get_queryset() on BriefModeMixin, minus prefetch logic

* get_prefetches_for_serializer() should reference serializer field source if set
2024-02-14 09:28:37 -05:00
Jeremy Stretch
cd8e977418 Fixes #14879: Include custom fields in REST API representation of data sources 2024-01-22 15:54:26 -05:00
Jeremy Stretch
7323668dd0 Closes #13334: Record error message on failed jobs (#14106) 2023-10-31 08:34:57 -04:00
Jeremy Stretch
30ce9edf1c Closes #13381: Enable plugins to register custom data backends (#14095)
* Initial work on #13381

* Fix backend type display in table column

* Fix data source type choices during bulk edit

* Misc cleanup

* Move backend utils from core app to netbox

* Move backend type validation from serializer to model
2023-10-24 11:35:53 -04:00
Abhimanyu Saharan
49af70a77d fixes choice field schema for response #12960 2023-06-23 14:21:51 -04:00
Abhimanyu Saharan
c8cbced55e fix permission #12818 2023-06-14 14:43:18 +05:30
jeremystretch
20f0464824 Fix OpanAPI schema base path 2023-05-01 17:01:51 -04:00
Abhimanyu Saharan
d3206d9bf9 Added method to update viewset description (#12218)
* wip

* wip

* updated description on viewset

* fixed model name

* Update schema.py

* Update schema.py
2023-04-25 14:37:05 -04:00
Arthur
dda56f21f3 #12256 remove read-only fields from writable serializers 2023-04-20 14:11:55 -04:00
Arthur
31c909c368 #12149 remove spectacular choice mapping fixup internal one 2023-04-20 14:10:05 -04:00
Arthur Hanson
ecd0c56554 Closes #9608: Move from drf-yasg to spectacular
Co-authored-by: arthanson <worldnomad@gmail.com>
Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-03-30 14:32:59 -04:00
Jeremy Stretch
d2a694a878 Closes #12068: Establish a direct relationship from jobs to objects (#12075)
* Reference database object by GFK when running scripts & reports via UI

* Reference database object by GFK when running scripts & reports via API

* Remove old enqueue_job() method

* Enable filtering jobs by object

* Introduce ObjectJobsView

* Add tabbed views for report & script jobs

* Add object_id to JobSerializer

* Move generic relation to JobsMixin

* Clean up old naming
2023-03-28 15:47:09 -04:00
jeremystretch
34236ff468 Update release notes 2023-03-27 14:20:13 -04:00
jeremystretch
40572b543f Rename JobResult to Job and move to core 2023-03-27 14:20:13 -04:00
Jeremy Stretch
d8784d4155 Closes #11558: Add support for remote data sources (#11646)
* WIP

* WIP

* Add git sync

* Fix file hashing

* Add last_synced to DataSource

* Build out UI & API resources

* Add status field to DataSource

* Add UI control to sync data source

* Add API endpoint to sync data sources

* Fix display of DataSource job results

* DataSource password should be write-only

* General cleanup

* Add data file UI view

* Punt on HTTP, FTP support for now

* Add DataSource URL validation

* Add HTTP proxy support to git fetcher

* Add management command to sync data sources

* DataFile REST API endpoints should be read-only

* Refactor fetch methods into backend classes

* Replace auth & git branch fields with general-purpose parameters

* Fix last_synced time

* Render discrete form fields for backend parameters

* Enable dynamic edit form for DataSource

* Register DataBackend classes in application registry

* Add search indexers for DataSource, DataFile

* Add single & bulk delete views for DataFile

* Add model documentation

* Convert DataSource to a primary model

* Introduce pre_sync & post_sync signals

* Clean up migrations

* Rename url to source_url

* Clean up filtersets

* Add API & filterset tests

* Add view tests

* Add initSelect() to HTMX refresh handler

* Render DataSourceForm fieldsets dynamically

* Update compiled static resources
2023-02-19 20:09:51 -05:00