blob: f962a875027236eea96a0a324b237dfa35769e48 [file] [log] [blame]
David K. Bainbridgec04fd552016-11-08 18:39:29 -08001{
2 "devices": {
3 {{ range $index, $element := .Devices }}{{ if $index }},
4 {{ end }}"{{ .Id }}": {
5 "segmentrouting": {
6 "name": "device-{{ .ChassisId }}",
7 "nodeSid": {{ add 100 $index }},
8 "routerIp": "{{ .Annotations.ManagementAddress }}",
9 "routerMac": "{{ .Mac }}",
10 "isEdgeRouter": {{ .IsEdgeRouter }},
11 "adjacencySids": []
12 }
13 }{{ end }}
14 },
15 "hosts": {
16 {{ range $index, $element := .Hosts }}{{ if $index }},
David K. Bainbridge40d484c2016-12-12 15:14:22 -080017 {{ end }}"{{ .Mac }}/-1": {
David K. Bainbridge74bdba62017-06-14 13:11:25 -070018 "basic" : {
19 "ips": ["{{ range $idx_ip, $ip := .IpAddresses }}{{if $idx_ip}},{{end}}{{ $ip }}{{ end }}"],
20 "location": "{{ .Location.ElementID }}/{{ .Location.Port }}"
21 }
David K. Bainbridgec04fd552016-11-08 18:39:29 -080022 }{{ end }}
23 },
24 "ports": {
25 {{ range $index, $element := .Hosts }}{{ if $index }},
26 {{ end }}"{{ .Location.ElementID }}/{{ .Location.Port }}": {
27 "interfaces": [
28 {
29 "ips": [ "{{ gateway .IpAddresses }}" ]
30 }
31 ]
32 }{{ end }}
33 },
34 "links": {},
35 "apps": {}
36}