devops-models
Typed serde models for common DevOps configuration formats.
Zero browser dependencies — works in any Rust target: native CLIs, CI/CD plugins, cloud functions, and WASM.
Supported formats
| Format | Types |
|---|---|
| Kubernetes | Deployment, Service, ConfigMap, Secret, Ingress, HPA, CronJob, Job, PVC, NetworkPolicy, StatefulSet, DaemonSet, Role, ClusterRole, RoleBinding, ClusterRoleBinding, ServiceAccount |
| CI/CD | GitLab CI pipelines, GitHub Actions workflows |
| Containers | Docker Compose |
| Monitoring | Prometheus, Alertmanager |
| Configuration | Helm values, Ansible playbooks |
| API | OpenAPI 3.x |
| LLM | ChatMessage, ChatRequest/Response, LlmProvider, LlmConfig |
Quick start
[]
= "0.1"
Parse a Kubernetes Deployment
use K8sDeployment;
let yaml = r#"
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
namespace: production
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: app
image: my-app:v1.2.3
resources:
limits:
memory: "256Mi"
cpu: "500m"
"#;
let deployment: K8sDeployment = from_str.unwrap;
println!;
Validate with the ConfigValidator trait
All models implement ConfigValidator, which provides structure + semantic validation:
use ConfigValidator;
use K8sCronJob;
let cronjob: K8sCronJob = from_str.unwrap;
let result = cronjob.validate;
if !result.valid
for warn in &result.warnings
Parse a Docker Compose file
use DockerCompose;
let compose: DockerCompose = from_str.unwrap;
LLM configuration
use ;
let config = LlmConfig ;
println!;
Error handling
use ;
Feature flags
This crate has no optional feature flags — all types are always available and have no platform-specific dependencies.
Relationship to other crates
- devops-validate — YAML validation and auto-repair engine built on top of these models.
- devops-toolkit — Meta-crate that re-exports both.
License
Licensed under either of MIT or Apache-2.0, at your option.