tosca_definitions_version: tosca_simple_yaml_1_0

description: created by platform-install/roles/cord-profile/templates/volt-devices.yaml.j2

imports:
   - custom_types/xos.yaml

topology_template:
  node_templates:

# vOLT service defined in services.yaml
    service#volt:
      type: tosca.nodes.VOLTService
      properties:
          no-create: True
          no-delete: True
          no-update: True

# vOLT devices
{% for device in volt_devices %}
    {{ device.name }}-{{ device.index | default(loop.index) }}:
      type: tosca.nodes.VOLTDevice
      properties:
            driver: {{ device.driver | default("pmc-olt") }}
            openflow_id: {{ device.openflow_id }}
            access_devices: {{ device.access_devices }}
      requirements:
          - volt_service:
              node: service#volt
              relationship: tosca.relationships.MemberOfService
          - access_agent:
              node: {{ device.name }}-agent-{{ device.index | default(loop.index) }}
              relationship: tosca.relationships.UsesAgent

    {{ device.name }}-agent-{{ device.index | default(loop.index) }}:
      type: tosca.nodes.AccessAgent
      properties:
          mac: {{ device.agent_mac }}
          port_mappings: {{ device.agent_port_mappings }}
      requirements:
          - volt_service:
              node: service#volt
              relationship: tosca.relationships.MemberOfService

{% endfor %}

