Luca Prete | b601c38 | 2018-04-30 16:10:43 -0700 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Matteo Scandolo | af3c994 | 2018-06-27 14:03:12 -0700 | [diff] [blame] | 15 | # curl -H "xos-username: admin@opencord.org" -H "xos-password: letmein" -X POST --data-binary @fabric-config.yaml http://192.168.99.100:30007/run |
Luca Prete | b601c38 | 2018-04-30 16:10:43 -0700 | [diff] [blame] | 16 | |
| 17 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 18 | imports: |
| 19 | - custom_types/switch.yaml |
| 20 | - custom_types/switchport.yaml |
| 21 | - custom_types/portinterface.yaml |
Scott Baker | a3b3ff2 | 2019-01-23 11:25:18 -0800 | [diff] [blame] | 22 | - custom_types/fabricipaddress.yaml |
Luca Prete | b601c38 | 2018-04-30 16:10:43 -0700 | [diff] [blame] | 23 | description: Configures fabric switches and related ports |
| 24 | topology_template: |
| 25 | node_templates: |
| 26 | switch#leaf1: |
| 27 | type: tosca.nodes.Switch |
| 28 | properties: |
| 29 | driver: ofdpa3 |
| 30 | ipv4Loopback: 192.168.0.201 |
| 31 | ipv4NodeSid: 17 |
| 32 | isEdgeRouter: True |
| 33 | name: leaf1 |
| 34 | ofId: of:0000000000000001 |
| 35 | routerMac: 00:00:02:01:06:01 |
Luca Prete | b601c38 | 2018-04-30 16:10:43 -0700 | [diff] [blame] | 36 | |
| 37 | # Setup a fabric switch port |
| 38 | port#port1: |
| 39 | type: tosca.nodes.SwitchPort |
| 40 | properties: |
| 41 | portId: 1 |
| 42 | requirements: |
| 43 | - switch: |
| 44 | node: switch#leaf1 |
| 45 | relationship: tosca.relationships.BelongsToOne |
| 46 | |
| 47 | # Setup a fabric switch port interface |
| 48 | interface#interface1: |
| 49 | type: tosca.nodes.PortInterface |
| 50 | properties: |
Luca Prete | b601c38 | 2018-04-30 16:10:43 -0700 | [diff] [blame] | 51 | name: port1 |
| 52 | requirements: |
| 53 | - port: |
| 54 | node: port#port1 |
| 55 | relationship: tosca.relationships.BelongsToOne |
Matteo Scandolo | dfe75ff | 2018-06-15 10:52:09 -0700 | [diff] [blame] | 56 | |
Scott Baker | a3b3ff2 | 2019-01-23 11:25:18 -0800 | [diff] [blame] | 57 | # Setup a fabric switch port interface |
| 58 | ipaddress#ipaddress1: |
| 59 | type: tosca.nodes.FabricIpAddress |
| 60 | properties: |
| 61 | ip: 192.168.0.254/24 |
| 62 | description: some ip address |
| 63 | requirements: |
| 64 | - interface: |
| 65 | node: interface#interface1 |
| 66 | relationship: tosca.relationships.BelongsToOne |
| 67 | |
Matteo Scandolo | dfe75ff | 2018-06-15 10:52:09 -0700 | [diff] [blame] | 68 | # Setup a fabric switch port with host_learning disabled |
| 69 | port#port2: |
| 70 | type: tosca.nodes.SwitchPort |
| 71 | properties: |
| 72 | portId: 2 |
| 73 | host_learning: false |
| 74 | requirements: |
| 75 | - switch: |
| 76 | node: switch#leaf1 |
| 77 | relationship: tosca.relationships.BelongsToOne |