David K. Bainbridge | c04fd55 | 2016-11-08 18:39:29 -0800 | [diff] [blame] | 1 | { |
| 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. Bainbridge | 40d484c | 2016-12-12 15:14:22 -0800 | [diff] [blame] | 17 | {{ end }}"{{ .Mac }}/-1": { |
David K. Bainbridge | 74bdba6 | 2017-06-14 13:11:25 -0700 | [diff] [blame] | 18 | "basic" : { |
| 19 | "ips": ["{{ range $idx_ip, $ip := .IpAddresses }}{{if $idx_ip}},{{end}}{{ $ip }}{{ end }}"], |
| 20 | "location": "{{ .Location.ElementID }}/{{ .Location.Port }}" |
| 21 | } |
David K. Bainbridge | c04fd55 | 2016-11-08 18:39:29 -0800 | [diff] [blame] | 22 | }{{ 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 | } |