Skip to content

Support Import/Export of Portable Custom Object Bundles #613

Description

@christianbur

Plugin Version

0.6.0

Proposed functionality

The Custom Objects plugin already includes a Portable Schema, which provides an excellent foundation for sharing Custom Object definitions between NetBox instances.

I propose adding native support for importing and exporting complete Custom Object Bundles directly from the UI.

A bundle should contain everything required to deploy a reusable solution on another NetBox instance, including:

  • Choice Sets
  • Custom Object Types
  • Relationships
  • Field definitions
  • Display templates
  • Validators (where applicable)
  • Navigation metadata
  • Seed/example objects
  • Bundle metadata (name, version, author, description)

Import workflow

  1. Navigate to Custom Objects → Import Bundle
  2. Upload a JSON or YAML bundle
  3. Preview the objects that will be created or updated
  4. Confirm the import

Export workflow

Users should be able to select one or more Custom Object Types and export them as a portable bundle that can be shared with other NetBox installations.

The bundle format should be based on the existing Portable Schema wherever possible.

Combined with the improvements proposed in #610, this would enable complete domain-specific applications to be distributed as declarative JSON/YAML bundles instead of traditional Python plugins.

A single bundle could define an entire solution, including data model, UI configuration, relationships, and example data, allowing users to install it with only a few clicks.

Use case

Use case

Today, sharing a complete Custom Object solution requires manually recreating every part of the model:

  • Choice Sets
  • Custom Object Types
  • Relationships
  • Display templates
  • Example (seed) objects

Supporting bundle import/export would make Custom Objects significantly easier to share, version, and reuse across NetBox installations.

Organizations could maintain internal libraries of approved bundles, while the community could publish reusable bundles for common NetBox use cases.

Example bundle

For example, a reusable Circuit Inventory bundle could be distributed as a single JSON file:

{
  "schema_version": "1",
  "choice_sets": [
    {
      "name": "Circuit Status",
      "slug": "circuit-status",
      "choices": [
        { "value": "planned", "label": "Planned" },
        { "value": "active", "label": "Active" },
        { "value": "decommissioned", "label": "Decommissioned" }
      ]
    }
  ],
  "types": [
    {
      "name": "circuit",
      "slug": "circuit",
      "verbose_name": "Circuit",
      "verbose_name_plural": "Circuits",
      "description": "WAN circuit inventory",
      "fields": [
        {
          "id": 1,
          "name": "carrier",
          "type": "text",
          "required": true
        },
        {
          "id": 2,
          "name": "bandwidth_mbps",
          "type": "integer",
          "validation_minimum": 0
        },
        {
          "id": 3,
          "name": "status",
          "type": "choice",
          "choice_set": "circuit-status"
        }
      ],
      "removed_fields": []
    }
  ],
  "objects": [
    {
      "type": "circuit",
      "data": {
        "carrier": "Example ISP",
        "bandwidth_mbps": 1000,
        "status": "active"
      }
    },
    {
      "type": "circuit",
      "data": {
        "carrier": "Backup ISP",
        "bandwidth_mbps": 500,
        "status": "planned"
      }
    }
  ]
}

After importing the bundle, the user would immediately have:

  • Choice Sets
  • Custom Object Types
  • Example objects

without manually creating each component.

Community ecosystem

Combined with the enhancements discussed in #610, this could enable a new class of lightweight "plugins" that require no Python code.

Instead of developing and maintaining traditional NetBox plugins, many extensions could be distributed as declarative JSON/YAML bundles that users simply import into NetBox.

This would dramatically lower the barrier for extending NetBox while fostering a community ecosystem of reusable "light plugins".

External dependencies

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions