alien4cloud / alien4cloud

Application LIfecycle ENablement for Cloud
http://alien4cloud.org
Apache License 2.0
76 stars 68 forks source link

Support for tosca normatives types without explicit import #129

Open ekowsal opened 6 years ago

ekowsal commented 6 years ago

I am able to import csar containing the topology template using tosca normatives types without explicit import of tosca normative types. For example:

`tosca_definitions_version: tosca_simple_yaml_1_0

metadata: template_name: new_node_type template_version: 0.1.0-SNAPSHOT template_author: admin

description: "This archive has been created by Kowsalya."

node_types:

my_Node_Server:
    derived_from: tosca.nodes.Compute
    properties:
        cmd1:
          type: string
          required: true`

But If I try to edit the topology in topology editor using tosca normative types, It's adding import of tosca-normative-types in topology.yaml which is not needed. It's good to remove the below import and give default support for tosca-normative-types as it is default supported types. Please share your thoughts. `imports:

Thanks, Kowsalya

OresteVisari commented 6 years ago

Hi,

I think we should always specify all required archives (with the appropriate version number). That will allow the possibility for some users to add their own 'tosca-normative-types' for custom purpose.

ekowsal commented 6 years ago

Hi,

As per TOSCA specification, we are not supposed to import tosca normative types explicitly. Refer section 3.1.2 TOSCA Namespacing in TOSCA Service Templates, Point 3.

specification

Automatically imports (without the use of an explicit import statement) the normative type definitions (e.g., Node, Relationship, Capability, Artifact, etc.) that are associated with the TOSCA Simple Profile Specification the TOSCA Namespace Alias value identifies.

And more over, the default behaviour of tosca-normative-types for the version 1.0.0 should not be changed/customised by any user. If they wish to customise/change, they should use different name and version for it.

ekowsal commented 6 years ago

Please share your thoughts....

EdgarLGB commented 6 years ago

@ekowsal Well, actually we do not follow strictly the TOSCA specification and the explicit import is an alternative that we chose to deal with the tosca normative type. Effectively, the implicit import is well supported by the TOSCA specification but it is not our case.