Namespaces:
  =: io.murano.apps.example.plugin
  res: io.murano.resources

Name: ImageValidatorMixin

Extends:
  - res:Instance

Properties:
  requiredType:
    Contract: $.string().notNull()

Methods:
  validateImage:
    Body:
      - $environment: $.find(std:Environment).require()
      - Try:
        - $glance: new('io.murano.extensions.mirantis.example.Glance', $environment)
        Catch:
          With: 'murano.dsl.exceptions.NoPackageForClassFound'
          Do:
            Throw: PluginNotFoundException
            Message: 'Plugin for interaction with Glance is not installed'
      - $glanceImage: $glance.getById($.image)
      - If: $glanceImage = null
        Then:
          Throw: ImageNotFoundException
          Message: 'Image with specified Id was not found'
      - If: $glanceImage.meta = null
        Then:
          Throw: InvalidImageException
          Message: 'Image does not contain Murano metadata tag'
      - If: $glanceImage.meta.type != $.requiredType
        Then:
          Throw: InvalidImageException
          Message: 'Image has unappropriate Murano type'

Namespaces:
  =: io.murano.apps.example.plugin
  res: io.murano.resources
  std: io.murano

Name: ImageValidatorMixin

Extends:
  - res:Instance

Properties:
  requiredType:
    Contract: $.string().notNull()

Methods:
  validateImage:
    Body:
      - $environment: $.find(std:Environment).require()
      - Try:
        - $glance: new('io.murano.extensions.mirantis.example.Glance', $environment)
        Catch:
          With: 'murano.dsl.exceptions.NoPackageForClassFound'
          Do:
            Throw: PluginNotFoundException
            Message: 'Plugin for interaction with Glance is not installed'
      - $glanceImage: $glance.getById($.image)
      - If: $glanceImage = null
        Then:
          Throw: ImageNotFoundException
          Message: 'Image with specified Id was not found'
      - If: $glanceImage.meta = null
        Then:
          Throw: InvalidImageException
          Message: 'Image does not contain Murano metadata tag'
      - If: $glanceImage.meta.type != $.requiredType
        Then:
          Throw: InvalidImageException
          Message: 'Image has unappropriate Murano type'

Add io.murano namespace to demo app for example plugin
Add io.murano namespace to demo app for example plugin

Change-Id: I0a7fa28f0b56efa74478ea63fe4060c63957493b
Closes-Bug: #1595207
