Skip to main content

Publish changes to NATS

Project description

Nautobot Changelog Reporting Through Nats

Introduction

This is an event broker for Nautobot that publishes events to NATS.

Configuration

Add this to your nautobot_config.py:

connect = {}

# Optional path to a credentials file.
if "NATS_CRED" in os.environ:
    connect["user_credentials"] = os.environ["NATS_CRED"]

from nautobot.core.events import register_event_broker
from nautobot_nats_broker import NATSEventBroker

register_event_broker(
    NATSEventBroker(
        servers="nats-server-url",
        stream="nautobot",
        **connect,
    )
)

Example Outputs

This is what shows up on NATS when you have this plugin configured and then create a new Namespace resource:

{
  "request": {
    "id": "501a0004-0fdd-404e-b46c-d2a189d868df",
    "user": "test_user"
  },
  "event": "create",
  "model": "ipam.namespace",
  "record": {
    "id": "c310b8cc-bceb-49a2-b323-c109ed828b10",
    "url": "/api/ipam/namespaces/c310b8cc-bceb-49a2-b323-c109ed828b10/",
    "name": "test_namespace",
    "tags": [],
    "created": "2026-03-25T19:18:15.841125Z",
    "display": "test_namespace",
    "location": null,
    "notes_url": "/api/ipam/namespaces/c310b8cc-bceb-49a2-b323-c109ed828b10/notes/",
    "description": "",
    "object_type": "ipam.namespace",
    "last_updated": "2026-03-25T19:18:15.841138Z",
    "natural_slug": "test_namespace_c310",
    "custom_fields": {}
  },
  "@url": "/api/ipam/namespaces/c310b8cc-bceb-49a2-b323-c109ed828b10/",
  "@timestamp": "2026-03-25T19:18:15Z",
  "response": {
    "host": "test_host.example.com"
  }
}

Publishing

Publishing is handled by GitHub Actions through PyPI Trusted Publishing.

The release workflow uses two tag types:

  • X.Y.Z-rc.N on a commit that is not reachable from main exercises the release process, creates a GitHub prerelease, uploads package assets, and skips PyPI upload.
  • X.Y.Z on a commit that is reachable from main creates a GitHub release, uploads package assets, and publishes those assets to PyPI.

The version in pyproject.toml must stay in stable X.Y.Z form. Release candidate tags use the same base version. For example, pyproject.toml can contain 1.2.3 while the RC tag is 1.2.3-rc.1.

  1. Update the version number in pyproject.toml.

  2. Update and verify the lock file.

uv lock
uv lock --check
  1. Commit the version and lock-file changes.
git add pyproject.toml uv.lock
git commit -m "Release X.Y.Z"
  1. Exercise the release flow with a release candidate tag from the branch containing the version-change commit before it is merged to main.
git checkout <release-branch>
git push origin HEAD
git tag X.Y.Z-rc.1
git push origin X.Y.Z-rc.1

Expected result: GitHub Actions validates the tag, builds the package, creates a prerelease, uploads the package assets, and skips PyPI publishing.

  1. Merge the version-change branch to main, then create and push the stable release tag from main.
git checkout main
git pull --ff-only
git tag X.Y.Z
git push origin X.Y.Z

Expected result: GitHub Actions validates the tag, builds the package, creates a release, uploads the package assets, and publishes to PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nautobot_broker_nats-1.2.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nautobot_broker_nats-1.2.3-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file nautobot_broker_nats-1.2.3.tar.gz.

File metadata

  • Download URL: nautobot_broker_nats-1.2.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nautobot_broker_nats-1.2.3.tar.gz
Algorithm Hash digest
SHA256 6ea683c7f87d38b5a6ba11a96ca33f4a6c147f889ab75be7eb3d6a42dbcd1af2
MD5 92c0ad02e1ee18c4644d002f723f4801
BLAKE2b-256 1c4e3e3eeadaa083a97082a28cdd73feac7d79d9cbb51a076bddc726b3ff82a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for nautobot_broker_nats-1.2.3.tar.gz:

Publisher: publish.yml on NVIDIA/nautobot-broker-nats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nautobot_broker_nats-1.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for nautobot_broker_nats-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c33bca5b0440d6b72f5e95c04cc49c369f31cee2506a6a19c7a72e4be5dbf51c
MD5 2420f43b5d5dcd210e68067292a59ca0
BLAKE2b-256 5b040ecd6dbc6a225ea9be3463ae6e36ca83712f55dbfd92144bb839a6e8e1f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nautobot_broker_nats-1.2.3-py3-none-any.whl:

Publisher: publish.yml on NVIDIA/nautobot-broker-nats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page