Ekaterina Chernova c504477a68 Refactor test plugin app
* Obsolete methods names changed
* Reserved words were misspelled

Change-Id: Iacb6ade31acbb6802df5d6e64e3583b90d00794e
2015-05-18 17:23:07 +03:00

37 lines
1.0 KiB
YAML

Namespaces:
=: io.murano.apps.example.plugin
res: io.murano.resources
Name: ImageValidatorMixin
Extends:
- res:Instance
Properties:
requiredType:
Contract: $.string().notNull()
Methods:
validateImage:
Body:
- Try:
- $glance: new('io.murano.extensions.mirantis.example.Glance')
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'