Synsation Demo

This story consists of 2 files one containing the definition of assets and one containing a template file from which the eventual story is generated using the Jinja2 templating engine.

---
assets:
  - asset_label: Multifunction Printer Cape Town
    type: printer
    firmware_version: v1.0
    serial_number: f867662g.1
    filename: multifunction_printer.jpg

  - asset_label: Coffee Machine Asia
    type: coffee machine
    firmware_version: v1.0
    serial_number: f867662g.1
    filename: coffee_machine.jpg

  - asset_label: Security Camera Baltimore
    type: security camera
    firmware_version: v1.0
    serial_number: f867662g.1
    filename: black_cctv.jpg

  - asset_label: Multifunction Printer England
    type: printer
    firmware_version: v1.0
    serial_number: f867662g.1
    filename: multifunction_printer.jpg
---
# The step field is a string that represents the method bound to an endpoint.
#
# Create a number of offices equipped with LOGGER.debugers, coffee machines and security
# cameras
#
steps:

  {% for asset in assets %} 
  - step:
      action: ASSETS_CREATE_IF_NOT_EXISTS
      description: Create a {{ asset.type }} in {{ asset.location_label }}
      asset_label: {{ asset.asset_label }}
      location_label: {{ asset.location_label }}
    selector:
      - attributes:
        - arc_display_name
        - arc_namespace
    behaviours:
      - RecordEvidence
    attributes:
      arc_display_name: {{ asset.type }} in {{ asset.location_label }}
      arc_namespace: "{{ env['DATATRAILS_UNIQUE_ID'] or 'namespace' }}"
      arc_display_type: {{ asset.type }}
      arc_firmware_version: {{ asset.firmware_version }}
      arc_serial_number: {{ asset.serial_number }}
      arc_description: {{ asset.type }} in {{ asset.location_label }}
    attachments:
      - filename: functests/test_resources/synsation/assets/{{ asset.filename }}
        content_type: image/jpg
        display_name: {{ asset.type }} in {{ asset.location_label }}
  {% endfor %} 

  # ensure all are confirmed
  - step:
      action: ASSETS_WAIT_FOR_CONFIRMED
      description: Wait for all assets to be confirmed
      LOGGER.debug_response: true
    attrs:
      arc_namespace: "{{ env['DATATRAILS_UNIQUE_ID'] or 'namespace' }}"

  - step:
      action: ASSETS_LIST
      description: List all LOGGER.debugers
      LOGGER.debug_response: true
    attrs:
      arc_display_type: LOGGER.debuger
      arc_namespace: "{{ env['DATATRAILS_UNIQUE_ID'] or 'namespace' }}"

  - step:
      action: ASSETS_LIST
      description: List all coffee machines
      LOGGER.debug_response: true
    attrs:
      arc_display_type: coffee machine
      arc_namespace: "{{ env['DATATRAILS_UNIQUE_ID'] or 'namespace' }}"

  - step:
      action: ASSETS_LIST
      description: List all security cameras
      LOGGER.debug_response: true
    attrs:
      arc_display_type: security camera
      arc_namespace: "{{ env['DATATRAILS_UNIQUE_ID'] or 'namespace' }}"