On Sun, Sep 3, 2017 at 4:06 AM, Ran Ziv <[email protected]> wrote:

> I too agree with the notion that picking a substituting service template
> explicitly is against the spirit of this feature, for the reasons Avia has
> explained.
> If a specific template is needed, why not import it directly, or require a
> more specific capability offered by the substituting service template?
>

Just like you can specify a specific node template for a requirement, I
believe it can be useful and often necessary to specify a substituted
service template.

Let me try an example:

topology_template:
  node_templates:
    my_app:
      type: WebApp
      requirements:
        host:
          capability: tosca.capabilities.Container
          node: my_host # explicit node template
        db:
          capability: MongoDb
    my_host:
      type: VirtualMachine

  policies:
    substitution:
      type: aria.Substitution
      targets: [ my_app ]
      properties:
        requirements: # map of strings to requirement policy infos
          db:
            service_template: /opt/templates/MongoDbCluster.csar # explicit
service template

Reply via email to