aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name-changeassign.xml
blob: e2dc3e32a921ea3a15b8a39808f702aa578ad0b1 (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
<service-logic
    xmlns='http://www.onap.org/sdnc/svclogic'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
    <method rpc='self-serve-vf-module-generate-name-changeassign' mode='sync'>
        <block atomic='true'>
            <set>
                <parameter name='tmp.external-key.value' value='' />
            </set>
            <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.resource-key_length`' >
                <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].name`'>
                    <outcome value='external-key'>
                        <set>
                            <parameter name='tmp.external-key.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].value`' />
                        </set>
                    </outcome>
                </switch>
            </for>
            <switch test='`$tmp.external-key.value`'>
                <outcome value=''>
                    <return status='failure'>
                        <parameter name='ack-final' value='Y'/>
                        <parameter name="error-code" value="500" />
                        <parameter name="error-message" value="self-service-vf-module-generate-name-changeassign error : external-key is null for vf-module" />
                    </return>
                </outcome>
            </switch>
            <set>
                <parameter name="tmp.vf-module.changeassign.naming-data-payload" value="`'{&quot;elements&quot;:[{' + '&quot;resource-name&quot;:&quot;' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].name + '&quot;,&quot;resource-value&quot;:&quot;' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value + '&quot;,&quot;external-key&quot;:&quot;' + $tmp.external-key.value + '&quot;}]}'`"/>
            </set>
            <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.AssignNameNode' method='process'>
                <parameter name='payload' value='`$tmp.vf-module.changeassign.naming-data-payload`' />
                <parameter name="prifix" value="vf-module.changeassign.nameGenResponse" />
                <outcome value='failure'>
                    <block atomic='true'>
                        <set>
                            <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
                        </set>
                        <return status='failure'>
                            <parameter name='ack-final' value='Y'/>
                            <parameter name="error-code" value="500" />
                            <parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vf-module ' + $error-message`" />
                        </return>
                    </block>
                </outcome>
                <outcome value='not-found'>
                    <block atomic='true'>
                        <set>
                            <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
                        </set>
                        <return status='failure'>
                            <parameter name='ack-final' value='Y'/>
                            <parameter name="error-code" value="500" />
                            <parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vf-module ' + $error-message`" />
                        </return>
                    </block>
                </outcome>
            </execute>
            <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" 
	resource="vf-module" key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id AND vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id " >
                <parameter name="vf-module-name" value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value`' />
                <outcome value='failure'>
                    <block atomic='true'>
                        <set>
                            <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
                        </set>
                        <return status='failure'>
                            <parameter name='ack-final' value='Y'/>
                            <parameter name="error-code" value="500" />
                            <parameter name="error-message" value="`'Failed to update vf-module.vf-module-name to ' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value + ' in AnAI'`" />
                        </return>
                    </block>
                </outcome>
                <outcome value='not-found'>
                    <block atomic='true'>
                        <set>
                            <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
                        </set>
                        <return status='failure'>
                            <parameter name='ack-final' value='Y'/>
                            <parameter name="error-code" value="500" />
                            <parameter name="error-message" value="`'Failed to update vf-module.vf-module-name to ' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value + ' in AnAI'`" />
                        </return>
                    </block>
                </outcome>
            </update>
            <set>
                <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].value`' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value`'/>
                <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='SUCCESS' />
            </set>
        </block>
    </method>
</service-logic>
ss="nt">"component-node" : { } }, "interfaces" : { "ResourceAssignmentComponent" : { "operations" : { "process" : { "inputs" : { "template-names" : [ "base-config-template", "licence-template" ], "action-name" : { "get_input" : "action-name" }, "template-name" : { "get_input" : "template_name" }, "template-version" : { "get_input" : "template-version" }, "resource-type" : "vnf-type", "request-id" : { "get_input" : "request-id" }, "resource-id" : { "get_input" : "hostname" } }, "outputs" : { "resource-assignment-params" : "success", "status" : "status" } } } } } }, "resource-assignment-action" : { "type" : "dg-resource-assignment", "properties" : { "mode" : "sync", "version" : "LATEST", "is-start-flow" : false }, "capabilities" : { "dg-node" : { } }, "requirements" : { "component-dependency" : { "capability" : "component-node", "node" : "resource-assignment-ra-component", "relationship" : "tosca.relationships.DependsOn" } }, "interfaces" : { "CONFIG" : { "operations" : { "ResourceAssignment" : { "inputs" : { "params" : [ ] } } } } } }, "activate-action" : { "type" : "dg-activate-netconf", "properties" : { "mode" : "sync", "version" : "LATEST", "is-start-flow" : false }, "capabilities" : { "dg-node" : { } }, "requirements" : { "component-dependency" : { "capability" : "component-node", "node" : "activate-netconf-component", "relationship" : "tosca.relationships.DependsOn" } }, "interfaces" : { "CONFIG" : { "operations" : { "ActivateNetconf" : { "inputs" : { "params" : [ ] } } } } } }, "base-config-template" : { "type" : "artifact-config-template", "properties" : { "action-names" : [ "resource-assignment-action" ] }, "capabilities" : { "content" : { "properties" : { "content" : "db://base-config-template" } }, "mapping" : { "properties" : { "mapping" : [ { "name" : "rs-db-source", "property" : { "required" : true, "type" : "string" }, "input-param" : false, "dictionary-name" : "sample-db-source", "dictionary-source" : "primary-db", "dependencies" : [ "hostname" ], "version" : 0 }, { "name" : "mdsal-source", "property" : { "description" : "", "required" : true, "type" : "list", "entry_schema" : { "type" : "dt-v4-aggregate" } }, "input-param" : false, "dictionary-name" : "sample-mdsal-source", "dictionary-source" : "primary-config-data", "dependencies" : [ "service-instance-id" ], "version" : 0 }, { "name" : "hostname", "property" : { "required" : true, "type" : "string" }, "dictionary-name" : "hostname", "dictionary-source" : "input", "version" : 0, "input-param" : false }, { "name" : "service", "property" : { "required" : true, "type" : "string" }, "dictionary-name" : "service", "dictionary-source" : "input", "version" : 0, "input-param" : false }, { "name" : "service-instance-id", "property" : { "required" : true, "type" : "string" }, "dictionary-name" : "service-instance-id", "dictionary-source" : "input", "version" : 0, "input-param" : false } ] } } } }, "licence-template" : { "type" : "artifact-config-template", "properties" : { "action-names" : [ "resource-assignment-action" ] }, "capabilities" : { "content" : { "properties" : { "content" : "db://licence-template" } }, "mapping" : { "properties" : { "mapping" : [ { "name" : "licenses", "property" : { "required" : true, "type" : "list", "entry_schema" : { "type" : "dt-license-key" } }, "input-param" : false, "dictionary-name" : "sample-licenses", "dictionary-source" : "primary-config-data", "dependencies" : [ "service-instance-id" ], "version" : 0 }, { "name" : "service-instance-id", "property" : { "required" : true, "type" : "string" }, "dictionary-name" : "service-instance-id", "dictionary-source" : "input", "version" : 0, "input-param" : false } ] } } } } } } }