summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/fulltest/singleSubstitution/computeWithDiffPortTypeAndServerGroup/out/MainServiceTemplate.yaml
blob: 4096acade3547115d06a57097ec945c1f6e17968 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow
tosca_definitions_version: tosca_simple_yaml_1_0_0
metadata:
  template_name: Main
imports:
- openecomp_heat_index:
    file: openecomp-heat/_index.yml
- GlobalSubstitutionTypes:
    file: GlobalSubstitutionTypesServiceTemplate.yaml
topology_template:
  inputs:
    port_name:
      hidden: false
      immutable: false
      annotations:
        source:
          type: org.openecomp.annotations.Source
          properties:
            vf_module_label:
            - hot-mog-0108-bs1271
            source_type: HEAT
            param_name: port_name
      type: string
      description: port name
      default: port_name
    vnf_id:
      hidden: false
      immutable: false
      annotations:
        source:
          type: org.openecomp.annotations.Source
          properties:
            vf_module_label:
            - hot-mog-0108-bs1271
            source_type: HEAT
            param_name: vnf_id
      type: string
      description: Unique ID for this VNF instance
      default: This_is_ths_SCP_id
    smp_name_1:
      hidden: false
      immutable: false
      annotations:
        source:
          type: org.openecomp.annotations.Source
          properties:
            vf_module_label:
            - hot-mog-0108-bs1271
            source_type: HEAT
            param_name: smp_name_1
      type: string
      description: name of VM
      default: vSMP2
    flavor_smp_name:
      hidden: false
      immutable: false
      annotations:
        source:
          type: org.openecomp.annotations.Source
          properties:
            vf_module_label:
            - hot-mog-0108-bs1271
            source_type: HEAT
            param_name: flavor_smp_name
      type: string
      description: SCP SMP Flavor
      default: m3.xlarge
    image_smp_name:
      hidden: false
      immutable: false
      annotations:
        source:
          type: org.openecomp.annotations.Source
          properties:
            vf_module_label:
            - hot-mog-0108-bs1271
            source_type: HEAT
            param_name: image_smp_name
      type: string
      description: SCP SMP image
      default: asc_base_image_smp
    availability_zone_0:
      hidden: false
      immutable: false
      annotations:
        source:
          type: org.openecomp.annotations.Source
          properties:
            vf_module_label:
            - hot-mog-0108-bs1271
            source_type: HEAT
            param_name: availability_zone_0
      type: string
      default: zone_1
    lab_name:
      hidden: false
      immutable: false
      annotations:
        source:
          type: org.openecomp.annotations.Source
          properties:
            vf_module_label:
            - hot-mog-0108-bs1271
            source_type: HEAT
            param_name: lab_name
      type: string
      description: Lab name
      default: Lab-1
  node_templates:
    abstract_smp:
      type: org.openecomp.resource.abstract.nodes.smp
      directives:
      - substitutable
      properties:
        compute_smp_name:
        - get_input: smp_name_1
        compute_smp_availability_zone:
        - get_input: availability_zone_0
        port_port1_replacement_policy:
        - AUTO
        port_port1_network:
        - get_input: port_name
        vm_flavor_name:
          get_input: flavor_smp_name
        compute_smp_user_data_format:
        - RAW
        vm_image_name:
          get_input: image_smp_name
        port_port1_subinterface_indicator:
        - false
        port_port1_ip_requirements:
        - ip_version: 4
          ip_count_required:
            is_required: false
          floating_ip_count_required:
            is_required: false
        port_port1_mac_requirements:
          mac_count_required:
            is_required: false
        compute_smp_metadata:
        - jx_vm_role: smp2
          vnf_id:
            get_input: vnf_id
          jx_lab_name:
            get_input: lab_name
        compute_smp_scheduler_hints:
        - group: BE_Affinity_group
        service_template_filter:
          substitute_service_template: Nested_smpServiceTemplate.yaml
          count: 1
        index_value:
          get_property:
          - SELF
          - service_template_filter
          - index_value
    port2:
      type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
      properties:
        replacement_policy: AUTO
        ip_requirements:
        - ip_version: 4
          ip_count_required:
            is_required: false
          floating_ip_count_required:
            is_required: false
        mac_requirements:
          mac_count_required:
            is_required: false
        network:
          get_input: port_name
  groups:
    hot-mog-0108-bs1271_group:
      type: org.openecomp.groups.heat.HeatStack
      properties:
        heat_file: ../Artifacts/hot-mog-0108-bs1271.yml
        description: ASC Template
      members:
      - port2
      - abstract_smp
    BE_Affinity_group:
      type: tosca.groups.Root
      members:
      - abstract_smp
  policies:
    BE_Affinity_policy:
      type: org.openecomp.policies.placement.Colocate
      properties:
        name: def
        affinity: host
      targets:
      - BE_Affinity_group
>("label1")); operationInputDefinitionList.add(createMockOperationInputDefinition("label2")); operationInputDefinitionList.add(createMockOperationInputDefinition("label2")); Collection<Operation> operations = createInterfaceOperationData("op2", "interface operation2",new ArtifactDefinition(), operationInputDefinitionList,"create"); Either<Boolean, ResponseFormat> booleanResponseFormatEither = interfaceOperationValidationUtilTest .validateInterfaceOperations(operations, RESOURCE_ID, false); Assert.assertTrue(booleanResponseFormatEither.isRight()); } @Test public void testInterfaceOperationUniqueInputParamNameValid() { operationInputDefinitionList.add(createMockOperationInputDefinition("label1")); operationInputDefinitionList.add(createMockOperationInputDefinition("label2")); Collection<Operation> operations = createInterfaceOperationData("op2", "interface operation2",new ArtifactDefinition(), operationInputDefinitionList,"update"); Either<Boolean, ResponseFormat> booleanResponseFormatEither = interfaceOperationValidationUtilTest .validateInterfaceOperations(operations, RESOURCE_ID, false); Assert.assertTrue(booleanResponseFormatEither.isLeft()); } private Set<Operation> createInterfaceOperationData( String uniqueID, String description, ArtifactDefinition artifactDefinition, ListDataDefinition<OperationInputDefinition> inputs, String name) { return Sets.newHashSet(createInterfaceOperation(uniqueID, description, artifactDefinition, inputs, name)); } private <T extends Component> Either<T, StorageOperationStatus> getToscaFullElement() { return Either.left((T) setUpResourceMock()); } private Resource setUpResourceMock(){ Resource resource = new Resource(); resource.setInterfaces(createMockInterfaceDefinition()); return resource; } private Map<String, InterfaceDefinition> createMockInterfaceDefinition() { Map<String, Operation> operationMap = createMockOperationMap(); Map<String, InterfaceDefinition> interfaceDefinitionMap = new HashMap<>(); interfaceDefinitionMap.put("int1", createInterface("int1", "Interface 1", "lifecycle", "tosca", operationMap)); return interfaceDefinitionMap; } private class InterfaceOperationValidationUtilTest extends InterfaceOperationValidation { protected ResponseFormatManager getResponseFormatManager() { return mock; } } }