Skip to content

Allow ImageAttachments to be created/bulk-uploaded independently of assignment to devices/racks #21317

@bctiemann

Description

@bctiemann

NetBox version

v4.5.1

Feature type

New functionality

Proposed functionality

There is a client-identified need to be able to bulk-upload image attachments programmatically, prior to the corresponding devices or racks existing, and then assign the images to those objects once they are created.

Currently, image attachments can only be created via the "Attach an image" workflow from a rack or device detail page; an "unattached" image cannot be created.

The proposal is to make it possible to upload images arbitrarily, singly and/or in bulk, and allow them to be assigned later (i.e. through a "bulk assignment" API endpoint) to devices/racks through ingestion of a data file mapping image IDs to object IDs, or other such construct.

An alternate proposal, which would be less invasive and would not require data model changes, would be to have a bulk-upload function that requires the devices/racks to already have been created, and to require (as part of the bulk upload) a mapping of image filename to device/rack object PK, and the assignments would take place during the save of each uploaded image object.

Use case

Users are currently uploading images individually for their racks and devices, which is proving to be time-consuming at scale. They want a way to bulk upload images first and then associate them with devices or racks afterward.

Because the use case is primarily driven by the cumbersome nature of individual file uploads per device, the need might alternatively be met by having the "bulk upload" functionality require a list or mapping of devices/racks to which each uploaded image would be assigned, and all such device/rack objects would need to have been created in advance of bulk-uploading.

Database changes

The ImageAttachment model would need to be modified to permit creation of records without any object_type/object_id, which are currently non-nullable.

External dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity: highExpected to require a large amont of time and effort to implement relative to other tasksnetboxstatus: backlogAwaiting selection for worktype: featureIntroduction of new functionality to the application

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions