openits-models

module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2026 License: Apache-2.0

README

openits-models

The OpenITS data-model layer, extracted from the Vikasa monorepo as a standalone, importable Go module. This repo owns the vendor-neutral model definitions and the code generated from them; downstream components (e.g. openits-collector) consume it as a dependency.

Module path: github.com/Vikasa2M/openits-models

Layout

Path Contents
yang/ YANG source modules (the source of truth for the model).
api/proto/ Protobuf sources: hand-authored command.proto/device.proto plus generated openits/v1/*.proto (event payloads + shared types), produced from yang/ by the in-repo YANG→proto generator (tools/yang-proto-gen).
pkg/proto/openits/v1/ Generated Go protobuf types (package openitspb).
pkg/yang/openits/ Generated ygot Go types (package openits).
schema-registry/ AsyncAPI/JSON-schema registry entries per service.
bindings/nats/ NATS reference profile: subject grammar, CloudEvents envelope, JetStream notes (README.md) and the generated asyncapi.yaml (see note below). The transport-neutral model layer above does not depend on it.
scripts/, tools/ Model generation, validation, and lint tooling.
docs/ Design rationale — how the model is shaped and why.

Design & rationale

The model's shape is deliberate, and much of it is a direct application of OpenConfig's lessons: many small, independently-versioned modules rather than a mega-module per device; leaning into the telemetry side that OpenConfig got right; and avoiding the one-size-fits-all configuration side that fractured. See:

Using it

go get github.com/Vikasa2M/openits-models@latest
import (
    openitspb "github.com/Vikasa2M/openits-models/pkg/proto/openits/v1"
    openits   "github.com/Vikasa2M/openits-models/pkg/yang/openits"
)

Non-Go implementers should start from the curated release bundle instead (yang/, api/proto/, schema-registry/, bindings/ — attached to each GitHub release).

Regeneration

make gen             # yang -> proto (tools/yang-proto-gen) -> pkg/proto (protoc); yang -> pkg/yang (ygot)
make check-gen       # gen, then fail if output drifts from what's committed (freshness gate)
make yang-proto-gen  # yang -> api/proto/openits/v1/*.proto (event payloads + shared types) + field-numbers.yaml lock
make proto           # api/proto -> pkg/proto (protoc)
make yang            # yang -> pkg/yang (ygot fakeroot structs)
make validate-yang check-revisions check-naming
make validate-noi check-graduation check-augment-collisions

command.proto/device.proto under api/proto/ are hand-curated and untouched by make yang-proto-gen.

Requires protoc/buf, ygot/goyang, and (optionally) pyang and yanglint.

bindings/nats/asyncapi.yaml is carried here as a published artifact of the NATS reference profile, regenerated in-repo from the YANG-derived ce-type catalog by make asyncapi. See bindings/nats/README.md for the profile spec and docs/07-conformance.md for the two-tier (model vs. NATS-profile) conformance model.

Provenance

openits-models is self-contained: the YANG modules are the source of truth, and every other artifact (protobuf, Go, JSON Schema, AsyncAPI, schema-registry snapshots) is generated from them by in-repo tooling. No other repository is required to build, generate, or validate this repo. The collector and other consumers depend on this module; this module depends on none of them.

Contributing, versioning & releases

  • CONTRIBUTING.md — the edit-YANG-then-regenerate workflow and the full set of gates CI enforces.
  • docs/versioning.md — how the Go module version, per-module YANG revisions, and protobuf wire compatibility relate, plus the step-by-step release process.
  • CHANGELOG.md — notable changes per release.

CI (.github/workflows/ci.yml) runs the full gate on every push and PR: generation freshness, go build/vet/test, buf lint + breaking-change detection, YANG governance checks, yanglint instance-data validation, and the conformance harness across all device kinds.

License

Licensed under the Apache License 2.0. See NOTICE for attribution, including the vendored IETF YANG modules under yang/ietf/.

Directories

Path Synopsis
pkg
yang/openits
Package openits is a generated package which contains definitions of structs which represent a YANG schema.
Package openits is a generated package which contains definitions of structs which represent a YANG schema.
tools
arcit-coverage command
Command arcit-coverage scans openits YANG modules for `arc-it-flow` annotations and emits a Markdown report diffing them against an ARC-IT inventory.
Command arcit-coverage scans openits YANG modules for `arc-it-flow` annotations and emits a Markdown report diffing them against an ARC-IT inventory.
check-augment-collisions command
check-augment-collisions fails when two augments target the same YANG node.
check-augment-collisions fails when two augments target the same YANG node.
check-ce-id-vectors command
check-ce-id-vectors re-derives every published ce-id test vector in docs/ce-id-spec.md straight from the algorithm that document specifies, and fails if any of them disagrees.
check-ce-id-vectors re-derives every published ce-id test vector in docs/ce-id-spec.md straight from the algorithm that document specifies, and fails if any of them disagrees.
check-deviations command
check-deviations validates yang/deviations/*.yang modules: each deviation must RESOLVE against the base openits YANG modules, and it may only TIGHTEN the base contract — never loosen it.
check-deviations validates yang/deviations/*.yang modules: each deviation must RESOLVE against the base openits YANG modules, and it may only TIGHTEN the base contract — never loosen it.
check-events-layering command
check-events-layering enforces the events-module layering rule: every yang/*-events.yang module may import only
check-events-layering enforces the events-module layering rule: every yang/*-events.yang module may import only
check-graduation command
check-graduation reports per-augment NoI counts, independent-org counts, operator presence, and graduation eligibility.
check-graduation reports per-augment NoI counts, independent-org counts, operator presence, and graduation eligibility.
conformance command
Command conformance runs the OpenITS conformance suite against a device under test.
Command conformance runs the OpenITS conformance suite against a device under test.
conformance/tests
Package tests contains the OpenITS conformance test functions.
Package tests contains the OpenITS conformance test functions.
noi-validator command
noi-validator walks schema-registry/notices/ and validates every NoI YAML against schema-registry/notices/_schema/noi-schema.yaml — the single source of truth.
noi-validator walks schema-registry/notices/ and validates every NoI YAML against schema-registry/notices/_schema/noi-schema.yaml — the single source of truth.
openits-new-service command
openits-new-service scaffolds the boilerplate-heavy files for a new service package.
openits-new-service scaffolds the boilerplate-heavy files for a new service package.
yang-proto-gen command
Command yang-proto-gen generates protobuf definitions from the openits YANG modules using goyang.
Command yang-proto-gen generates protobuf definitions from the openits YANG modules using goyang.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL