schemas

package
v2.19.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 0 Imported by: 0

README

OpenCHAMI Schema Repository

Welcome to the OpenCHAMI Schema Repository! This repository serves as the central source for all JSON schemas used across the OpenCHAMI consortium. By maintaining a unified set of schemas, we ensure consistency and compatibility across all OpenCHAMI projects.

Overview

This repository contains JSON schemas that define the structure and validation rules for data used across various OpenCHAMI projects. Each schema is generated from Go structs using reflection, ensuring that the schema remains consistent with the underlying data models.

Directory Structure

The repository is organized as follows:

  • schemas/: This directory contains all the Go structs that will become JSON schemas, each in its own file. Schemas are named according to their purpose or associated data structure.
  • examples/: This directory contains example payloads that conform to the schemas. These examples serve as references for developers implementing or integrating with OpenCHAMI components.
  • docs/: Documentation related to the schemas, including detailed descriptions and usage guidelines, is found here.

How to Contribute

We welcome contributions to the schema repository! Here’s how you can get involved:

  1. Fork the Repository: Start by forking this repository to your own GitHub account.
  2. Create a Branch: Create a new branch for your changes.
  3. Add/Update Schemas: Modify or add new Go structs in the appropriate files. Use reflection to generate the corresponding JSON schema.
  4. Test Your Changes: Ensure that your changes are valid and conform to the repository’s guidelines. Include example payloads in the examples/ directory.
  5. Submit a Pull Request: Once your changes are ready, submit a pull request for review.

Generating JSON Schemas

Schemas in this repository are generated from Go structs using reflection. Here’s an example of how to generate a JSON schema:

package schemas

// Example struct definition
type Node struct {
    ID   string `json:"id"`
    Name string `json:"name"`
    IP   string `json:"ip"`
}

Schema Versioning

Each schema is versioned using an envelope/header format. This allows servers to verify the schema version before processing the contained data. Here’s an example:

package schemas

// Envelope structure for schema versioning
type Envelope struct {
    SchemaID   string      `json:"schema_id"`
    Version    string      `json:"version"`
    Payload    interface{} `json:"payload"`
}

Referencing Schemas

All schemas are published on a webpage for easy access and reference. Servers and clients can use these schemas to validate data and ensure compliance with OpenCHAMI standards.

Resources

License

This repository is licensed under the MIT License. See the LICENSE file for more details.


Thank you for contributing to the OpenCHAMI Schema Repository! Together, we can maintain a consistent and reliable set of data models for all OpenCHAMI projects.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionReset

type ActionReset struct {
	AllowableValues []string `json:"ResetType@Redfish.AllowableValues"`
	RFActionInfo    string   `json:"@Redfish.ActionInfo"`
	Target          string   `json:"target"`
	Title           string   `json:"title,omitempty"`
}

type ComputerSystemActions

type ComputerSystemActions struct {
	ComputerSystemReset ActionReset `json:"#ComputerSystem.Reset"`
}

type Envelope

type Envelope struct {
	SchemaID string      `json:"schema_id"`
	Version  string      `json:"version"`
	Payload  interface{} `json:"payload"`
}

Envelope structure for schema versioning

type EthernetInterface

type EthernetInterface struct {
	URI         string `json:"uri,omitempty"`         // URI of the interface
	MAC         string `json:"mac,omitempty"`         // MAC address of the interface
	IP          string `json:"ip,omitempty"`          // IP address of the interface
	Name        string `json:"name,omitempty"`        // Name of the interface
	Description string `json:"description,omitempty"` // Description of the interface
	Enabled     bool   `json:"enabled,omitempty"`     // Whether interface is enabled
}

type InventoryDetail

type InventoryDetail struct {
	URI                  string              `json:"uri,omitempty"`                  // URI of the BMC
	UUID                 string              `json:"uuid,omitempty"`                 // UUID of Node
	Manufacturer         string              `json:"manufacturer,omitempty"`         // Manufacturer of the Node
	SystemType           string              `json:"system_type,omitempty"`          // System type of the Node
	Name                 string              `json:"name,omitempty"`                 // Name of the Node
	Model                string              `json:"model,omitempty"`                // Model of the Node
	Serial               string              `json:"serial,omitempty"`               // Serial number of the Node
	BiosVersion          string              `json:"bios_version,omitempty"`         // Version of the BIOS
	EthernetInterfaces   []EthernetInterface `json:"ethernet_interfaces,omitempty"`  // Ethernet interfaces of the Node
	NetworkInterfaces    []NetworkInterface  `json:"network_interfaces,omitempty"`   // Network interfaces of the Node
	Power                *Power              `json:"power,omitempty"`                // Power state of the Node
	ProcessorCount       int                 `json:"processor_count,omitempty"`      // Processors of the Node
	ProcessorType        string              `json:"processor_type,omitempty"`       // Processor type of the Node
	MemoryTotal          float32             `json:"memory_total,omitempty"`         // Total memory of the Node in Gigabytes
	TrustedModules       []string            `json:"trusted_modules,omitempty"`      // Trusted modules of the Node
	TrustedComponents    []string            `json:"trusted_components,omitempty"`   // Trusted components of the Chassis
	Chassis_SKU          string              `json:"chassis_sku,omitempty"`          // SKU of the Chassis
	Chassis_Serial       string              `json:"chassis_serial,omitempty"`       // Serial number of the Chassis
	Chassis_AssetTag     string              `json:"chassis_asset_tag,omitempty"`    // Asset tag of the Chassis
	Chassis_Manufacturer string              `json:"chassis_manufacturer,omitempty"` // Manufacturer of the Chassis
	Chassis_Model        string              `json:"chassis_model,omitempty"`        // Model of the Chassis
	OdataId              string              `json:"@odata.id,omitempty"`            // OData ID for the computer system
	PowerURL             string              `json:"PowerURL,omitempty"`             // URL for power control
	PowerControl         []*PowerControl     `json:"PowerControl,omitempty"`         // Power control actions data
	Actions              []string            `json:"actions,omitempty"`              // Actions for the hardware
	Links                *Links              `json:"links,omitempty"`                // Links to related resources
}
type Links struct {
	Chassis  []string `json:"chassis,omitempty"`
	Managers []string `json:"managers,omitempty"`
}

type NetworkAdapter

type NetworkAdapter struct {
	URI          string `json:"uri,omitempty"`          // URI of the adapter
	Manufacturer string `json:"manufacturer,omitempty"` // Manufacturer of the adapter
	Name         string `json:"name,omitempty"`         // Name of the adapter
	Model        string `json:"model,omitempty"`        // Model of the adapter
	Serial       string `json:"serial,omitempty"`       // Serial number of the adapter
	Description  string `json:"description,omitempty"`  // Description of the adapter
}

type NetworkInterface

type NetworkInterface struct {
	URI         string         `json:"uri,omitempty"`         // URI of the interface
	Name        string         `json:"name,omitempty"`        // Name of the interface
	Description string         `json:"description,omitempty"` // Description of the interface
	Adapter     NetworkAdapter `json:"adapter,omitempty"`     // Adapter of the interface
}

type Power

type Power struct {
	State           string   `json:"state,omitempty"`
	PowerControlIDS []string `json:"power_control_ids,omitempty"`
}

type PowerControl

type PowerControl struct {
	ResourceID
	MemberId           string        `json:"MemberId,omitempty"`
	Name               string        `json:"Name,omitempty"`
	PowerCapacityWatts int           `json:"PowerCapacityWatts,omitempty"`
	RelatedItem        []*ResourceID `json:"RelatedItem,omitempty"`
}

type ResourceID

type ResourceID struct {
	OdataID string `json:"@odata.id"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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