summaryrefslogtreecommitdiffstats
path: root/tosca2heat/heat-translator/translator/tests/data/test_tosca_get_functions_semantic.yaml
blob: 6a6a485d2e6d50f3112fcd768cc6613adc68fe95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
tosca_definitions_version: tosca_simple_yaml_1_0

description: TOSCA template to test get_* functions semantic

node_types:
  tosca.capabilities.custom.Endpoint:
    derived_from: tosca.capabilities.Endpoint
    attributes:
      credential:
        type: tosca.datatypes.Credential

  tosca.capabilities.MyFeature:
    derived_from: tosca.capabilities.Root
    properties:
      my_list:
        type: list
      my_map:
        type: map

  tosca.nodes.WebApplication.MyApp:
    derived_from: tosca.nodes.WebApplication
    requirements:
      - myfeature:
          capability: tosca.capabilities.MyFeature
          node: tosca.nodes.MyDatabase
          relationship: tosca.relationships.ConnectsTo

  tosca.nodes.MyDatabase:
    derived_from: tosca.nodes.Database
    capabilities:
      myfeature:
        type: tosca.capabilities.MyFeature

  tosca.nodes.custom.Compute:
    derived_from: tosca.nodes.Compute
    capabilities:
      endpoint:
        type: tosca.capabilities.custom.Endpoint

topology_template:
  inputs:
    map_val:
      type: string

  node_templates:
    server:
      type: tosca.nodes.custom.Compute
      capabilities:
        host:
         properties:
           num_cpus: 1
           mem_size: 1 GB
        os:
          properties:
            type: Linux
            distribution: Ubuntu
            version: 12.04
            architecture: x86_64

    mysql_database:
      type: tosca.nodes.MyDatabase
      requirements:
        - host: server
      capabilities:
        myfeature:
          properties:
            my_list: [list_val_0]
            my_map:
              test_key: { get_input: map_val }
              test_key_static: static_value

    myapp:
      type: tosca.nodes.WebApplication.MyApp
      requirements:
        - myfeature: mysql_database
        - host: server
      interfaces:
        Standard:
          configure:
            implementation: myapp_configure.sh
            inputs:
              list_val: { get_property: [ SELF, myfeature, my_list, 0 ] }

  outputs:
    map_val:
      description: map_val
      value: { get_property: [ myapp, myfeature, my_map, test_key ] }

    static_map_val:
      value: { get_property: [ myapp, myfeature, my_map, test_key_static ] }

    concat_map_val:
      value: { concat: [ 'http://', { get_property: [ myapp, myfeature, my_map, test_key ] }, ':8080' ] }

    test_list_of_functions:
      value: [ { get_property: [ myapp, myfeature, my_map, test_key ] }, { get_property: [ myapp, myfeature, my_map, test_key_static ] } ]

    # should not be translated : complex type
    credential:
      value: { get_attribute: [server, endpoint, credential] }