1
|
[{"id":"9694d6d1.d85758","type":"dgstart","name":"DGSTART","outputs":1,"x":104.99999237060547,"y":43.36603832244873,"z":"7cae5554.a7c84c","wires":[["6d0e8921.574e78"]]},{"id":"6d0e8921.574e78","type":"service-logic","name":"GENERIC-RESOURCE-API ${project.version}","module":"GENERIC-RESOURCE-API","version":"${project.version}","comments":"","xml":"<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}'>","outputs":1,"x":395.67856216430664,"y":43.17558670043945,"z":"7cae5554.a7c84c","wires":[["8ce3613a.00883"]]},{"id":"8ce3613a.00883","type":"method","name":"method naming-policy-generate-unique-name","xml":"<method rpc='naming-policy-generate-unique-name' mode='sync'>\n","comments":"","outputs":1,"x":237.91672134399414,"y":115.71127033233643,"z":"7cae5554.a7c84c","wires":[["e55fe329.e072d"]]},{"id":"3063c4c.990bf3c","type":"comment","name":"naming-policy-generate-unique-name","info":"Input arguments:\ngenerate-unique-name-input.index-table-name - name of INDEX table\ngenerate-unique-name-input.index-table-prefix-column - name of prefix column in above table\ngenerate-unique-name-input.name-table-name - name of table holding all generated names\ngenerate-unique-name-input.index-length - non-null digit if index should be fixed length\n\nOutput arguments:\ngenerate-unique-name-output.generated-name - generated name (null if error)\ngenerate-unique-name-output.error-message - error message (non-null if error)\n","comments":"","x":792.559154510498,"y":36.66666793823242,"z":"7cae5554.a7c84c","wires":[]},{"id":"e55fe329.e072d","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":179.99999237060547,"y":189.61603832244873,"z":"7cae5554.a7c84c","wires":[["4e5a9b52.d59394"]]},{"id":"4e5a9b52.d59394","type":"switchNode","name":"switch generate-unique-name-input.action","xml":"<switch test='`$generate-unique-name-input.action`'>\n","comments":"","outputs":1,"x":285.0000228881836,"y":254.61604118347168,"z":"7cae5554.a7c84c","wires":[["c79681c5.c85a6","f782c2fe.b50f8","34e598cd.547d08","5f9e5e0c.20be2"]]},{"id":"c79681c5.c85a6","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":556.8332252502441,"y":254.8660774230957,"z":"7cae5554.a7c84c","wires":[["629ca82f.7cdc88"]]},{"id":"629ca82f.7cdc88","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.action not supplied' />\n","comments":"","x":727.5000019073486,"y":254.1993808746338,"z":"7cae5554.a7c84c","wires":[]},{"id":"f782c2fe.b50f8","type":"outcome","name":"ASSIGN","xml":"<outcome value='ASSIGN'>","comments":"","outputs":1,"x":561.2500610351562,"y":308.3660726547241,"z":"7cae5554.a7c84c","wires":[["826b2865.7e0898"]]},{"id":"34e598cd.547d08","type":"outcome","name":"DELETE","xml":"<outcome value='DELETE'>","comments":"","outputs":1,"x":564.2619934082031,"y":1548.4612164497375,"z":"7cae5554.a7c84c","wires":[["66b3b9cb.e29ee8"]]},{"id":"1e2c4141.71b96f","type":"call","name":"call generate-unique-name","xml":"<call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >\n","comments":"","outputs":1,"x":1385.2381629943848,"y":926.4256224632263,"z":"7cae5554.a7c84c","wires":[["da75856f.16a8f8"]]},{"id":"826b2865.7e0898","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":730.7500648498535,"y":308.3660430908203,"z":"7cae5554.a7c84c","wires":[["810613ad.81995","8621dfc4.da743","42af3be3.1c7914","413b7679.6a9c48","915b6cf6.6a091","1f764a1a.a7d3f6","bb2b984e.06a468"]]},{"id":"b4913758.6d64d8","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' \n\tvalue=\"`'Encountered error in naming-policy-generate-unique-name: ' + \n\t\t$generate-unique-name-output.error-message`\" />\n","comments":"","x":2001.4760627746582,"y":977.4612526893616,"z":"7cae5554.a7c84c","wires":[]},{"id":"6df1aa76.b53b44","type":"save","name":"query AAI: GET /nodes/object?key","xml":"<save plugin=\"org.onap.ccsdk.sli.adaptors.aai.AAIService\" \n\tresource=\"custom-query\"\n key=\"format = 'resource'\"\n force=\"true\"\n local-only=\"false\"\n pfx=\"tmp.nodes-query\">\n <parameter name=\"start[0]\" value=\"`$tmp.gname.custom-query-string + \n\t\t\t$encoded-name`\" />\n <parameter name=\"start_length\" value=\"1\" />","comments":"","outputs":1,"x":1409.202579498291,"y":1072.6279282569885,"z":"7cae5554.a7c84c","wires":[["a660d7e9.046738","e8a90561.64a3d8","c66c84fb.d66958"]]},{"id":"a660d7e9.046738","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1679.881202697754,"y":1136.1993236541748,"z":"7cae5554.a7c84c","wires":[["16f60ff4.382ec"]]},{"id":"e8a90561.64a3d8","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":1685.8095321655273,"y":1073.0208578109741,"z":"7cae5554.a7c84c","wires":[["8903b08f.7c326"]]},{"id":"c66c84fb.d66958","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1683.8095989227295,"y":1192.9136219024658,"z":"7cae5554.a7c84c","wires":[["a135dc4a.61d9d"]]},{"id":"810613ad.81995","type":"switchNode","name":"switch input.name-table-type","xml":"<switch test='`$generate-unique-name-input.name-table-type`'>\n","comments":"","outputs":1,"x":999.3928718566895,"y":398.1160683631897,"z":"7cae5554.a7c84c","wires":[["762e8292.fbea4c","7f7fd3dd.6f823c","6e8ab2c3.fc6bbc","bcdcb322.c1d22","c075a83f.5cee08","4e878c64.66aaf4"]]},{"id":"762e8292.fbea4c","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":1242.8928565979004,"y":398.36606454849243,"z":"7cae5554.a7c84c","wires":[["2c273d9d.ca4f82"]]},{"id":"2c273d9d.ca4f82","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />\n","comments":"","x":1414.5596332550049,"y":398.6993680000305,"z":"7cae5554.a7c84c","wires":[]},{"id":"4bc10430.8db0ac","type":"set","name":"set tmp.gname.custom-query-string: vnf-name","xml":"<set>\n<parameter name='tmp.gname.custom-query-string' value='nodes/generic-vnfs?vnf-name=' />\n","comments":"","x":1649.6786155700684,"y":450.68747758865356,"z":"7cae5554.a7c84c","wires":[]},{"id":"56c695a.0de4a6c","type":"set","name":"set tmp.gname.custom-query-string: vm-name","xml":"<set>\n<parameter name='tmp.gname.custom-query-string' value='nodes/vservers?vserver-name=' />\n","comments":"","x":1649.6786079406738,"y":503.54462480545044,"z":"7cae5554.a7c84c","wires":[]},{"id":"8c811a9e.3e2958","type":"set","name":"set tmp.gname.custom-query-string: network-name","xml":"<set>\n<parameter name='tmp.gname.custom-query-string' value='nodes/l3-networks?network-name=' />\n","comments":"","x":1665.3927421569824,"y":560.1160521507263,"z":"7cae5554.a7c84c","wires":[]},{"id":"1fbce4c6.d6002b","type":"set","name":"set tmp.gname.custom-query-string: vnfc-name","xml":"<set>\n<parameter name='tmp.gname.custom-query-string' value='nodes/vnfcs?vnfc-name=' />\n","comments":"","x":1655.571475982666,"y":668.4732518196106,"z":"7cae5554.a7c84c","wires":[]},{"id":"9bef47ef.8e3858","type":"set","name":"set tmp.gname.custom-query-string: service-instance-name","xml":"<set>\n<parameter name='tmp.gname.custom-query-string' value='nodes/service-instances?service-instance-name=' />\n","comments":"","x":1691.642894744873,"y":616.1160740852356,"z":"7cae5554.a7c84c","wires":[]},{"id":"a135dc4a.61d9d","type":"get-resource","name":"Update context_id = NON-ONAP","xml":"<update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n\tkey=\"update GENERIC_RESOURCE_NAME set context_id = $tmp.gun.nononap \n\t\tWHERE type = $generate-unique-name-input.name-table-type \n\t\tAND context_id = $tmp.gun.transient\">\n","comments":"","outputs":1,"x":1934.131046295166,"y":1192.1993341445923,"z":"7cae5554.a7c84c","wires":[["c2b6ccc5.17585","279b65b0.b767da"]]},{"id":"40711a8f.0be9c4","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' \n\tvalue=\"`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to ' \n\t\t+ $tmp.context-id.nononap`\" />\n\n","comments":"","x":2362.4170112609863,"y":1192.2232828140259,"z":"7cae5554.a7c84c","wires":[]},{"id":"c2b6ccc5.17585","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":2179.9884071350098,"y":1192.1518774032593,"z":"7cae5554.a7c84c","wires":[["40711a8f.0be9c4"]]},{"id":"279b65b0.b767da","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":2186.833808898926,"y":1238.640019416809,"z":"7cae5554.a7c84c","wires":[["9d767c72.52e7e"]]},{"id":"9d767c72.52e7e","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' \n\tvalue=\"`'No GENERIC_RESOURCE_NAME found with context_id = TRANSIENT and type = ' \n\t\t+ $generate-unique-name-input.name-table-type`\"/>\n","comments":"","x":2358.2740058898926,"y":1237.9135656356812,"z":"7cae5554.a7c84c","wires":[]},{"id":"42af3be3.1c7914","type":"set","name":"set tmp.gun.nononap","xml":"<set>\n<parameter name='tmp.gun.nononap' value='NON-ONAP' />\n","comments":"","x":977.3333625793457,"y":755.7708230018616,"z":"7cae5554.a7c84c","wires":[]},{"id":"8621dfc4.da743","type":"set","name":"set tmp.grn.loop.flag = true","xml":"<set>\n<parameter name='tmp.grn.loop.flag' value='true' />\n","comments":"","x":994.8094825744629,"y":867.627902507782,"z":"7cae5554.a7c84c","wires":[]},{"id":"8903b08f.7c326","type":"set","name":"set tmp.grn.loop.flag = false","xml":"<set>\n<parameter name='tmp.grn.loop.flag' value='false' />\n","comments":"","x":2120.2023849487305,"y":1072.592128753662,"z":"7cae5554.a7c84c","wires":[]},{"id":"413b7679.6a9c48","type":"whileNode","name":"while true","xml":"<while test='`$tmp.grn.loop.flag`'>\n","comments":"","outputs":1,"x":941.0594367980957,"y":925.7826733589172,"z":"7cae5554.a7c84c","wires":[["e0ac3aa7.fde448"]]},{"id":"e0ac3aa7.fde448","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1135.3094215393066,"y":925.7826685905457,"z":"7cae5554.a7c84c","wires":[["1e2c4141.71b96f","6df1aa76.b53b44","866eef8d.d7b6d"]]},{"id":"bb2b984e.06a468","type":"get-resource","name":"Update GENERIC_RESOURCE_NAME.context_id with input","xml":"<update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n\tkey=\"update GENERIC_RESOURCE_NAME set context_id = $generate-unique-name-input.context-id \n\t\tWHERE type = $generate-unique-name-input.name-table-type \n\t\tAND name = $generate-unique-name-output.generated-name \n\t\tAND context_id = $tmp.gun.transient\">\n","comments":"","outputs":1,"x":1096.5833930969238,"y":1393.532684803009,"z":"7cae5554.a7c84c","wires":[["168a0b59.e0dcc5","c5ad2e49.84e42"]]},{"id":"36cfa474.ccd78c","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' \n\tvalue=\"`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to ' \n\t\t+ $tmp.context-id.nononap`\" />\n\n","comments":"","x":1610.8693656921387,"y":1392.413718700409,"z":"7cae5554.a7c84c","wires":[]},{"id":"168a0b59.e0dcc5","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1428.4407539367676,"y":1392.485228061676,"z":"7cae5554.a7c84c","wires":[["36cfa474.ccd78c"]]},{"id":"c5ad2e49.84e42","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":1435.2861557006836,"y":1438.9733700752258,"z":"7cae5554.a7c84c","wires":[["33fab0ff.1fc5c"]]},{"id":"33fab0ff.1fc5c","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' \n\tvalue=\"`'No GENERIC_RESOURCE_NAME found with context_id = TRANSIENT and type = ' \n\t\t+ $generate-unique-name-input.name-table-type`\"/>\n","comments":"","x":1606.7263526916504,"y":1439.246916294098,"z":"7cae5554.a7c84c","wires":[]},{"id":"b95702ae.c6c2a","type":"call","name":"call rollback-generated-names","xml":"<call module='GENERIC-RESOURCE-API' rpc='rollback-generated-names' mode='sync' >\n","comments":"","outputs":1,"x":1027.0715293884277,"y":1654.63982629776,"z":"7cae5554.a7c84c","wires":[["28eb2083.a87d6"]]},{"id":"6d3be253.3ab7ec","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' \n\tvalue=\"`'Encountered error in rollback-generated-names: ' + \n\t\t$error-message`\" />\n","comments":"","x":1415.5000114440918,"y":1654.8184065818787,"z":"7cae5554.a7c84c","wires":[]},{"id":"da75856f.16a8f8","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1601.5952262878418,"y":925.7826342582703,"z":"7cae5554.a7c84c","wires":[["85b23c8b.82154"]]},{"id":"28eb2083.a87d6","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1252.9286613464355,"y":1655.068374156952,"z":"7cae5554.a7c84c","wires":[["6d3be253.3ab7ec"]]},{"id":"7da21ee3.54f6f","type":"set","name":"set rollback-generated-names-input.naming-type","xml":"<set>\n<parameter name='rollback-generated-names-input.naming-type' value='`$generate-unique-name-input.name-table-type`' />\n","comments":"","x":1077.7859121050155,"y":1549.4017415046692,"z":"7cae5554.a7c84c","wires":[]},{"id":"66b3b9cb.e29ee8","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":746.5001258850098,"y":1548.973156452179,"z":"7cae5554.a7c84c","wires":[["7da21ee3.54f6f","b95702ae.c6c2a","62fb838.4f6867c"]]},{"id":"62fb838.4f6867c","type":"set","name":"set rollback-generated-names-input.context-id","xml":"<set>\n<parameter name='rollback-generated-names-input.context-id' value='`$generate-unique-name-input.context-id`' />\n","comments":"","x":1072.30961227417,"y":1600.3064441680908,"z":"7cae5554.a7c84c","wires":[]},{"id":"d26b556.09bcda8","type":"set","name":"set tmp.grn.loop.flag = false","xml":"<set>\n<parameter name='tmp.grn.loop.flag' value='false' />\n","comments":"","x":2042.4998588562012,"y":926.1159682273865,"z":"7cae5554.a7c84c","wires":[]},{"id":"85b23c8b.82154","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1775.166576385498,"y":925.4492945671082,"z":"7cae5554.a7c84c","wires":[["d26b556.09bcda8","b4913758.6d64d8"]]},{"id":"915b6cf6.6a091","type":"set","name":"set tmp.gun.transient","xml":"<set>\n<parameter name='tmp.gun.transient' value='TRANSIENT' />\n","comments":"","x":975.3094749450684,"y":810.7826447486877,"z":"7cae5554.a7c84c","wires":[]},{"id":"6e8ab2c3.fc6bbc","type":"outcome","name":"VM_INSTANCE","xml":"<outcome value='VM_INSTANCE'>","comments":"","outputs":1,"x":1272.3571472167969,"y":503.5446434020996,"z":"7cae5554.a7c84c","wires":[["56c695a.0de4a6c"]]},{"id":"c075a83f.5cee08","type":"outcome","name":"VNFC_INSTANCE","xml":"<outcome value='VNFC_INSTANCE'>","comments":"","outputs":1,"x":1279.7499389648438,"y":668.1875047683716,"z":"7cae5554.a7c84c","wires":[["1fbce4c6.d6002b"]]},{"id":"bcdcb322.c1d22","type":"outcome","name":"NETWORK_INSTANCE","xml":"<outcome value='NETWORK_INSTANCE'>","comments":"","outputs":1,"x":1296.8491439819336,"y":559.8700408935547,"z":"7cae5554.a7c84c","wires":[["8c811a9e.3e2958"]]},{"id":"4e878c64.66aaf4","type":"outcome","name":"SERVICE_INSTANCE","xml":"<outcome value='SERVICE_INSTANCE'>","comments":"","outputs":1,"x":1290.6745681762695,"y":616.0129070281982,"z":"7cae5554.a7c84c","wires":[["9bef47ef.8e3858"]]},{"id":"7f7fd3dd.6f823c","type":"outcome","name":"VNF_INSTANCE","xml":"<outcome value='VNF_INSTANCE'>","comments":"","outputs":1,"x":1274.5633926391602,"y":450.58431243896484,"z":"7cae5554.a7c84c","wires":[["4bc10430.8db0ac"]]},{"id":"1f764a1a.a7d3f6","type":"switchNode","name":"switch generate-unique-name-input.context-id","xml":"<switch test='`$generate-unique-name-input.context-id`'>\n","comments":"","outputs":1,"x":1053.6428718566895,"y":308.2588601112366,"z":"7cae5554.a7c84c","wires":[["e200ce82.9543e"]]},{"id":"e200ce82.9543e","type":"not-found","name":"NULL","xml":"<outcome value=''>\n","comments":"","outputs":1,"x":1337.214199066162,"y":308.4970564842224,"z":"7cae5554.a7c84c","wires":[["33eb7c94.df9724"]]},{"id":"33eb7c94.df9724","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' \n\tvalue=\"generate-unique-name-input.context-id cannot be null for ASSIGN action\" />\n\n","comments":"","x":1516.7857551574707,"y":307.92557668685913,"z":"7cae5554.a7c84c","wires":[]},{"id":"5f9e5e0c.20be2","type":"outcome","name":"Other","xml":"<outcome value='Other'>","comments":"","outputs":1,"x":549.6428833007812,"y":1747.8303608894348,"z":"7cae5554.a7c84c","wires":[["75703775.1f4058"]]},{"id":"75703775.1f4058","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='generate-unique-name-output.error-message' value='Invalid generate-unique-name-input.action. Valid values are ASSIGN or DELETE' />\n","comments":"","x":720.3096599578857,"y":1747.163664340973,"z":"7cae5554.a7c84c","wires":[]},{"id":"16f60ff4.382ec","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":1870.7143478393555,"y":1136.2231798171997,"z":"7cae5554.a7c84c","wires":[["8903b08f.7c326","57783c58.a3f884"]]},{"id":"57783c58.a3f884","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' \n\tvalue=\"`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to ' \n\t\t+ $tmp.context-id.nononap`\" />\n\n","comments":"","x":2075.142951965332,"y":1135.6517171859741,"z":"7cae5554.a7c84c","wires":[]},{"id":"866eef8d.d7b6d","type":"execute","name":"encode generate-unique-name-output.generated-name","xml":"<execute plugin=\"org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils\" method=\"urlEncode\">\n\t<parameter name=\"source\" value='`$generate-unique-name-output.generated-name`'/>\n\t<parameter name=\"outputPath\" value=\"encoded-name\" />\n\n","comments":"","outputs":1,"x":1475.7142791748047,"y":999.9999923706055,"z":"7cae5554.a7c84c","wires":[[]]}]
|