YAML Reference
ネットワーク図定義のための YAML 記法リファレンス
YAML 形式で使用可能なすべてのオプションのリファレンスです。
基本構造
name: "Network Diagram"
description: "Optional description"
settings:
# グラフ設定
subgraphs:
# サブグラフ(グループ)定義
nodes:
# ノード(機器)定義
links:
# リンク(接続)定義Settings
settings:
direction: TB # レイアウト方向
theme: light # テーマ
legend: true # 凡例を表示
nodeSpacing: 50 # ノード間隔
rankSpacing: 100 # 階層間隔
subgraphPadding: 20 # サブグラフ内余白
canvas: # キャンバス設定
preset: A4
orientation: landscape
width: 1920
height: 1080
dpi: 150
fit: true
padding: 20direction
| 値 | エイリアス | 説明 |
|---|---|---|
TB | top-bottom | 上から下 |
BT | bottom-top | 下から上 |
LR | left-right | 左から右 |
RL | right-left | 右から左 |
theme
| 値 | 説明 |
|---|---|
light | ライトテーマ |
dark | ダークテーマ |
legend (凡例)
凡例を表示します。帯域幅、デバイスタイプ、ケーブルタイプなどの視覚要素を説明します。
# シンプル(デフォルト位置: 右上)
legend: true
# 詳細設定
legend:
enabled: true
position: top-right # 位置
showDeviceTypes: true # デバイスタイプを表示
showBandwidth: true # 帯域幅を表示
showCableTypes: true # ケーブルタイプを表示
showVlans: true # VLANを表示| position | 説明 |
|---|---|
top-left | 左上 |
top-right | 右上(デフォルト) |
bottom-left | 左下 |
bottom-right | 右下 |
canvas.preset (用紙サイズ)
A0, A1, A2, A3, A4, B0, B1, B2, B3, B4, letter, legal, tabloid
canvas.orientation
| 値 | エイリアス | 説明 |
|---|---|---|
portrait | p | 縦向き |
landscape | l | 横向き |
Nodes
nodes:
- id: router-1
label: "Router 1"
type: router
shape: rounded
parent: subgraph-id
rank: 1
vendor: yamaha
model: rtx3510
style:
fill: "#ffffff"
stroke: "#000000"
strokeWidth: 2
strokeDasharray: "5 5"
textColor: "#333333"
fontSize: 12
fontWeight: bold
opacity: 1.0label
単一行または複数行:
label: "Single line"
label:
- "<b>Bold title</b>"
- "Line 2"
- "---" # 区切り線
- "Line 3"type (デバイスタイプ)
| 値 | エイリアス | 説明 |
|---|---|---|
router | - | ルーター |
l3-switch | - | L3 スイッチ |
l2-switch | switch | L2 スイッチ |
firewall | fw | ファイアウォール |
load-balancer | lb | ロードバランサー |
server | - | サーバー |
access-point | ap | アクセスポイント |
cloud | - | クラウド |
internet | - | インターネット |
vpn | - | VPN |
database | db | データベース |
generic | - | 汎用 |
shape (ノード形状)
| 値 | エイリアス | 説明 |
|---|---|---|
rounded | round | 角丸四角形 (デフォルト) |
rect | rectangle | 四角形 |
circle | - | 円 |
diamond | rhombus | ひし形 |
hexagon | - | 六角形 |
cylinder | database | 円柱 |
stadium | pill | スタジアム形 |
trapezoid | - | 台形 |
vendor / model (ベンダーアイコン)
ハードウェアベンダーのアイコンを表示:
vendor: yamaha
model: rtx3510クラウドベンダーの場合:
vendor: aws
service: ec2
resource: instancesLinks
links:
# シンプル形式
- from: router-1
to: switch-1
# ポート指定
- from:
node: router-1
port: eth0
ip: 192.168.1.1
to:
node: switch-1
port: ge-0/0/0
# フル指定
- id: link-1
from: router-1
to: switch-1
label: "10G Uplink"
type: solid
arrow: none
bandwidth: 10G
redundancy: mlag
vlan: [10, 20, 30]
style:
stroke: "#2196F3"
strokeWidth: 2
strokeDasharray: "5 5"
opacity: 1.0
minLength: 100type (リンクタイプ)
| 値 | エイリアス | 説明 |
|---|---|---|
solid | - | 実線 (デフォルト) |
dashed | dotted | 破線 |
thick | - | 太線 |
double | - | 二重線 |
invisible | hidden | 非表示 |
arrow (矢印)
| 値 | エイリアス | 説明 |
|---|---|---|
none | - | 矢印なし |
forward | -> | 順方向 |
back | <- | 逆方向 |
both | <-> | 双方向 |
bandwidth (帯域幅)
回線の帯域幅を指定します。線の太さ(本数)で視覚的に表現されます。
| 値 | エイリアス | 視覚化 |
|---|---|---|
1G | 1GbE, 1Gbit | 1本線 |
10G | 10GbE, 10Gbit | 2本線 |
25G | 25GbE, 25Gbit | 3本線 |
40G | 40GbE, 40Gbit | 4本線 |
100G | 100GbE, 100Gbit | 5本線 |
redundancy (冗長化タイプ)
| 値 | エイリアス | 説明 |
|---|---|---|
ha | vrrp, hsrp, glbp, keepalive | HA ペア |
vc | virtual-chassis | Virtual Chassis |
vss | - | VSS |
vpc | - | vPC |
mlag | mclag | MLAG |
stack | stacking, irf | スタック |
vlan
リンクに関連付けられた VLAN を指定します。VLAN ID に基づいて色分けされます。
# 単一 VLAN
vlan: 10
# 複数 VLAN(トランク)
vlan: [10, 20, 30]- 単一 VLAN: VLAN ID に基づいた色で表示
- 複数 VLAN: トランクリンクとして表示、ラベルに VLAN 一覧を表示
Subgraphs
subgraphs:
- id: datacenter
label: "Data Center"
parent: null # ルートレベル
direction: LR # 内部レイアウト方向
vendor: aws
service: vpc
style:
fill: "#f0f8ff"
stroke: "#0072bc"
strokeWidth: 2
strokeDasharray: "5 5"
labelPosition: top
labelFontSize: 14
padding: 20
nodeSpacing: 50
rankSpacing: 100
- id: rack-1
label: "Rack 1"
parent: datacenter # ネストstyle.labelPosition
| 値 | 説明 |
|---|---|
top | 上部 |
bottom | 下部 |
left | 左側 |
right | 右側 |
Hierarchical Diagrams (階層型ダイアグラム)
複数のサイトや拠点を持つネットワークを、マルチファイル構成で管理できます。
基本構造
# main.yaml - 親ファイル
name: "Multi-Site Network"
subgraphs:
- id: headquarters
label: "Headquarters"
file: "./headquarters.yaml" # 外部ファイル参照
style:
fill: "#e3f2fd"
stroke: "#1565c0"
- id: branch
label: "Branch Office"
file: "./branch.yaml"
style:
fill: "#e8f5e9"
stroke: "#2e7d32"
links:
# サブグラフを跨ぐリンクはデバイスを直接参照
- from:
node: hq-router # headquarters.yaml 内のデバイス
port: wan1
to:
node: branch-router # branch.yaml 内のデバイス
port: wan1
label: "Site-to-Site VPN"
type: dashed# headquarters.yaml - 子ファイル
name: "Headquarters Network"
nodes:
- id: hq-router
label: "HQ-Router"
type: router
- id: hq-switch
label: "HQ-Switch"
type: l3-switch
links:
- from: { node: hq-router, port: lan1 }
to: { node: hq-switch, port: uplink }
bandwidth: 10Gfile (外部ファイル参照)
サブグラフに file 属性を指定すると、その内容を外部ファイルから読み込みます。
subgraphs:
- id: site-tokyo
label: "Tokyo DC"
file: "./sites/tokyo.yaml"クロスサブグラフリンク
異なるサブグラフに属するデバイス間のリンクは、デバイス名を直接指定します。 パーサーが自動的にどのサブグラフに属するか検出し、子シートビューにエクスポートコネクタを生成します。
links:
- from:
node: tokyo-router # tokyo.yaml 内のデバイス
port: wan1
to:
node: osaka-router # osaka.yaml 内のデバイス
port: wan1
label: "WAN Link"
bandwidth: 10Gシートナビゲーション
階層型ダイアグラムでは、サブグラフをクリックして詳細シートに移動できます。 各シートにはブレッドクラムナビゲーションが表示され、親シートに戻ることができます。
完全な例
name: "Enterprise Network"
description: "本社ネットワーク構成図"
settings:
direction: TB
theme: light
subgraphs:
- id: edge
label: "Edge Layer"
style:
fill: "#fff5f5"
stroke: "#d4a017"
- id: core
label: "Core Layer"
style:
fill: "#f0fff0"
stroke: "#228b22"
nodes:
- id: rt-01
label:
- "<b>RT-01</b>"
- "192.168.1.1"
type: router
vendor: yamaha
model: rtx3510
parent: edge
- id: sw-core-01
label: "<b>SW-CORE-01</b>"
type: l3-switch
vendor: juniper
model: ex4100-24mp
parent: core
links:
- from:
node: rt-01
port: lan1
to:
node: sw-core-01
port: ge-0/0/0
bandwidth: 10G
arrow: noneベンダーアイコン
| ベンダー | 使用例 |
|---|---|
| Yamaha | vendor: yamaha, model: rtx3510 |
| Aruba | vendor: aruba, service: access-switch |
| AWS | vendor: aws, service: ec2, resource: instances |