@shumoku/parser-yaml
v0.2.15
Published
YAML parser for shumoku network topology definitions
Maintainers
Readme
@shumoku/parser-yaml
YAML parser for Shumoku network topology definitions.
Installation
npm install @shumoku/parser-yaml @shumoku/coreUsage
import { YamlParser } from '@shumoku/parser-yaml'
const yaml = `
name: "Simple Network"
settings:
direction: TB
theme: light
nodes:
- id: rt-01
label: "Router 01"
type: router
- id: sw-01
label: "Switch 01"
type: l2-switch
links:
- from:
node: rt-01
port: lan1
to:
node: sw-01
port: ge-0/0/0
bandwidth: 10G
`
const parser = new YamlParser()
const graph = parser.parse(yaml)YAML Schema
Nodes
nodes:
- id: router-01
label: "Core Router"
type: router # router, l2-switch, l3-switch, firewall, server, etc.
vendor: yamaha # Optional: yamaha, aruba, aws, juniper
model: rtx3510 # Optional: vendor-specific model
parent: core-layer # Optional: subgraph IDLinks
links:
- from:
node: router-01
port: lan1
to:
node: switch-01
port: ge-0/0/0
bandwidth: 10G # Optional
label: "Uplink" # OptionalSubgraphs
subgraphs:
- id: core-layer
label: "Core Layer"Related Packages
@shumoku/core- Core library@shumoku/icons- Vendor icons
Documentation
- YAML Reference - Full syntax reference
- Playground - Interactive demo
License
MIT
