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 }}, |
| 17 | {{ end }}"{{ .Mac }}": { |
| 18 | "ips": ["{{ range $ip := .IpAddresses }}{{ $ip }}{{ end }}"], |
| 19 | "location": "{{ .Location.ElementID }}/{{ .Location.Port }}" |
| 20 | }{{ end }} |
| 21 | }, |
| 22 | "ports": { |
| 23 | {{ range $index, $element := .Hosts }}{{ if $index }}, |
| 24 | {{ end }}"{{ .Location.ElementID }}/{{ .Location.Port }}": { |
| 25 | "interfaces": [ |
| 26 | { |
| 27 | "ips": [ "{{ gateway .IpAddresses }}" ] |
| 28 | } |
| 29 | ] |
| 30 | }{{ end }} |
| 31 | }, |
| 32 | "links": {}, |
| 33 | "apps": {} |
| 34 | } |