aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.json
blob: ec1de4eae213374adfb591e7fe09e8f5d3603dec (plain)
1
[{"id":"977f53d.3ee9fb","type":"dgstart","name":"DGSTART","outputs":1,"x":107,"y":51,"z":"5f90649b.a6618c","wires":[["f60ed586.79f2e8"]]},{"id":"f60ed586.79f2e8","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":253.2380828857422,"y":125.95239353179932,"z":"5f90649b.a6618c","wires":[["7ed7da9d.6e2b64"]]},{"id":"7ed7da9d.6e2b64","type":"method","name":"contrail-route-topology-operation-create","xml":"<method rpc='contrail-route-topology-operation-create' mode='sync'>\n","comments":"","outputs":1,"x":333.1548500061035,"y":195.1904420852661,"z":"5f90649b.a6618c","wires":[["56f7100c.36c0c"]]},{"id":"56f7100c.36c0c","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","comments":"","outputs":1,"x":241.4761848449707,"y":338.523784160614,"z":"5f90649b.a6618c","wires":[["9e479a64.54c188","e3448fe7.bd93a","8da0a386.68f65","9aff23ea.c5706","14b94fc4.c4f09","98b3a116.8663e","15a1d923.552617","d9a64061.5a09f","8dd7a6c4.f97498","4c8c7d6c.390284","2f8ea3d3.25d61c","df03f36f.1c4a","c6e8d07f.0b15c","21f56f54.bd659","c191a157.b6674","f0fa32bd.ad602","9525be20.92483","63945192.1184c","dcc82b6d.bd0448","3fc1cd7b.ce8842","7ce279cd.dfcc18","84f94150.403b","674f14d2.772d8c","fa1647e6.8bb8f8"]]},{"id":"e3448fe7.bd93a","type":"returnSuccess","name":"return success","xml":"<return status='success'>\n<parameter name=\"ack-final-indicator\" value=\"Y\" />\n<parameter name=\"error-code\" value=\"200\" />\n<parameter name=\"error-message\" value=\"`$error-message`\" />\n","comments":"","x":439.7144775390625,"y":2006.7268590070307,"z":"5f90649b.a6618c","wires":[]},{"id":"9e479a64.54c188","type":"set","name":"set output to api handler","xml":"<set>\n<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />\n<parameter name='contrail-route-object-path' value=\"`$tmp.ar.self-link`\"/>\n<parameter name='service-object-path' value=\"`'restconf/config/GENERIC-RESOURCE-API:services/service/'\n + $contrail-route-topology-operation-input.service-information.service-instance-id\n + '/service-data/service-topology/'`\"/>\n \n","comments":"","x":468.4683837890625,"y":1969.182652387768,"z":"5f90649b.a6618c","wires":[]},{"id":"4c8c7d6c.390284","type":"set","name":"set allotted-resource-oper-status","xml":"<set>\n<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />\n<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />\n<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />\n<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />\n<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />\n","comments":"","x":501.8017692565918,"y":1841.563532743603,"z":"5f90649b.a6618c","wires":[]},{"id":"9aff23ea.c5706","type":"set","name":"set tmp.ar.self-link","xml":"<set>\n<parameter name='tmp.ar.self-link' value=\"`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'\n + $tmp.ar.allotted-resource-id\n + '/allotted-resource-data/contrail-route-topology/'` \" />\n\n","comments":"","x":503.7380561828613,"y":312.3333215713501,"z":"5f90649b.a6618c","wires":[]},{"id":"8da0a386.68f65","type":"set","name":"set tmp.ar.allotted-resource-id,etc","xml":"<set>\n<parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />\n<parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />\n\n\n\n","comments":"","x":550.9973297119141,"y":278.5925884246826,"z":"5f90649b.a6618c","wires":[]},{"id":"14b94fc4.c4f09","type":"execute","name":"execute Properties - pull properties file","xml":"<execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >\n    <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />\n    <parameter name='contextPrefix' value='prop' />\n","comments":"","outputs":1,"x":565.4219818115234,"y":348.23153495788574,"z":"5f90649b.a6618c","wires":[[]]},{"id":"15a1d923.552617","type":"execute","name":"execute RestApiCallNode - Get AR by id","xml":"<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >\n    <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />\n    <parameter name='restapiUser' value='`$prop.controller.user`' />\n    <parameter name='restapiPassword' value='`$prop.controller.pwd`' />\n    <parameter name='format' value='json' />\n    <parameter name='httpMethod' value='GET' />\n    <parameter name=\"responsePrefix\" value=\"mdsal-ar\" />\n\n","comments":"","outputs":1,"x":583.8520965576172,"y":519.7928762435913,"z":"5f90649b.a6618c","wires":[["a2f6a7ce.665958","f3b38cd6.2e6e6"]]},{"id":"98b3a116.8663e","type":"execute","name":"generate allotted-resource url","xml":"<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >\n    <parameter name=\"source\" value=\"`$prop.restapi.cr-allottedresource`\"/>\n    <parameter name=\"outputPath\" value=\"tmp.ar-url\"/>\n    <parameter name=\"target\" value=\"{allotted-resource-id}\"/>\n    <parameter name=\"replacement\" value=\"`$tmp.ar.allotted-resource-id`\"/>\n","comments":"","outputs":1,"x":538.0648651123047,"y":404.01720237731934,"z":"5f90649b.a6618c","wires":[[]]},{"id":"a2f6a7ce.665958","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":825.8148498535156,"y":517.2673225402832,"z":"5f90649b.a6618c","wires":[["20f015d.23979ea"]]},{"id":"d9a64061.5a09f","type":"execute","name":"execute RestApiCallNode - PUT AR by id","xml":"<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >\n    <parameter name='templateFileName' value=\"`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`\" />\n    <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />\n    <parameter name='restapiUser' value='`$prop.controller.user`' />\n    <parameter name='restapiPassword' value='`$prop.controller.pwd`' />\n    <parameter name='format' value='json' />\n    <parameter name='httpMethod' value='PUT' />\n    <parameter name=\"responsePrefix\" value=\"mdsal-ar\" />\n\n","comments":"","outputs":1,"x":519.0769958496094,"y":1926.0893211364746,"z":"5f90649b.a6618c","wires":[["c10dc6ee.696618","805abac4.a6c908","3cb9e4ff.c3e14c"]]},{"id":"c10dc6ee.696618","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":801.8849945068359,"y":1961.9445136152208,"z":"5f90649b.a6618c","wires":[["950a7649.40f1f8"]]},{"id":"805abac4.a6c908","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":792.8850440979004,"y":1930.4445393644273,"z":"5f90649b.a6618c","wires":[["950a7649.40f1f8"]]},{"id":"3cb9e4ff.c3e14c","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":796.635082244873,"y":1900.8016442395747,"z":"5f90649b.a6618c","wires":[["993aa5dc.bb4718"]]},{"id":"950a7649.40f1f8","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"Error updating md-sal for contrail-route-allotted-resource\" />\n","comments":"","x":962.635082244873,"y":1931.1945632062852,"z":"5f90649b.a6618c","wires":[]},{"id":"20f015d.23979ea","type":"block","name":"block: atomic","xml":"<block atomic=\"true\">\n","atomic":"false","comments":"","outputs":1,"x":994.8148536682129,"y":515.7672233581543,"z":"5f90649b.a6618c","wires":[["729d2c16.7a05d4"]]},{"id":"729d2c16.7a05d4","type":"switchNode","name":"switch cr length","xml":"<switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>\n","comments":"","outputs":1,"x":1205.6720962524414,"y":515.3863525390625,"z":"5f90649b.a6618c","wires":[["2012dd5e.936ac2","ea94432e.31d92"]]},{"id":"2012dd5e.936ac2","type":"other","name":"outcome 1","xml":"<outcome value='1'>\n","comments":"","outputs":1,"x":1395.0054016113281,"y":515.3863105773926,"z":"5f90649b.a6618c","wires":[["976ad675.132198"]]},{"id":"f33b796d.cb9ac8","type":"set","name":"set ar from get","xml":"<set>\n<parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />\n","comments":"","x":1868.1962203979492,"y":478.62452602386475,"z":"5f90649b.a6618c","wires":[]},{"id":"976ad675.132198","type":"block","name":"block: atomic","xml":"<block atomic='true'>\n","atomic":"false","comments":"","outputs":1,"x":1579.529291152954,"y":512.2911443710327,"z":"5f90649b.a6618c","wires":[["f33b796d.cb9ac8","20c37c8e.57cb74"]]},{"id":"26a328fb.e4fd48","type":"comment","name":"GET contrail-route-allotted-resource from mdsal","info":"","comments":"","x":593.8147926330566,"y":483.7672119140625,"z":"5f90649b.a6618c","wires":[]},{"id":"f0fa32bd.ad602","type":"set","name":"set ar-assignments.contrail-id","xml":"<set>\n<parameter name='ar-assignments.contrail-id' value=\"`$contrailResp.network-policy.uuid`\" />\n\n\n\n","comments":"","x":523.6721115112305,"y":1402.565318107605,"z":"5f90649b.a6618c","wires":[]},{"id":"20c37c8e.57cb74","type":"set","name":"save backup copy of mdsal-ar for rollback","xml":"<set>\n<parameter name='bk-cr-ar' value='$mdsal-ar.' />\n","comments":"","x":1956.0532722473145,"y":445.4340181350708,"z":"5f90649b.a6618c","wires":[]},{"id":"aa784c84.13ef8","type":"comment","name":"Create urls for restapi","info":"","comments":"","x":508.9576530456543,"y":377.62435245513916,"z":"5f90649b.a6618c","wires":[]},{"id":"993aa5dc.bb4718","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":938.2910499572754,"y":1896.9938134290278,"z":"5f90649b.a6618c","wires":[[]]},{"id":"8dd7a6c4.f97498","type":"execute","name":"execute getTime","xml":"<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >\n    <parameter name=\"outputPath\" value=\"tmp.current-time\" />\n\n","comments":"","outputs":1,"x":450.95776748657227,"y":1874.6602372266352,"z":"5f90649b.a6618c","wires":[[]]},{"id":"19d401c8.5d312e","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"404\" />\n    <parameter name=\"error-message\" value=\"Error: Contrail Route not found\" />\n    \n","comments":"","x":1545.3337326049805,"y":600.0000534057617,"z":"5f90649b.a6618c","wires":[]},{"id":"f3b38cd6.2e6e6","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":817.6666526794434,"y":552.3334074020386,"z":"5f90649b.a6618c","wires":[["2dce5d4a.489092"]]},{"id":"2dce5d4a.489092","type":"block","name":"block: atomic","xml":"<block atomic=\"true\">\n","atomic":"false","comments":"","outputs":1,"x":997.6666030883789,"y":552.9999580383301,"z":"5f90649b.a6618c","wires":[["19d401c8.5d312e"]]},{"id":"2f8ea3d3.25d61c","type":"set","name":"set ar data","xml":"<set>\n<parameter name='ar.allotted-resource-id' value=\"`$tmp.ar.allotted-resource-id` \" />\n<parameter name='ar.allotted-resource-status.action' value=\"`$contrail-route-topology-operation-input.request-information.request-action` \" />\n<parameter name='ar.allotted-resource-status.rpc-name' value=\"contrail-route-topology-operation\" />\n<parameter name='ar.allotted-resource-status.rpc-action' value=\"`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` \" />\n<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value=\"`$contrail-route-topology-operation-input.request-information.` \" />\n<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value=\"`$contrail-route-topology-operation-input.sdnc-request-header.` \" />\n<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value=\"`$contrail-route-topology-operation-input.service-information.` \" />\n<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value=\"`$contrail-route-topology-operation-input.allotted-resource-information.` \" />\n<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value=\"`$contrail-route-topology-operation-input.contrail-route-request-input.` \" />\n","comments":"","x":490.5238265991211,"y":557.8095149993896,"z":"5f90649b.a6618c","wires":[]},{"id":"ea94432e.31d92","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":1383.3333549499512,"y":552.6666707992554,"z":"5f90649b.a6618c","wires":[["19d401c8.5d312e"]]},{"id":"63945192.1184c","type":"set","name":"set cloud-region-id for input to contrail","xml":"<set>\n<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />\n","comments":"","x":547.3810729980469,"y":1208.9765033721924,"z":"5f90649b.a6618c","wires":[]},{"id":"ea06c71e.efa318","type":"comment","name":"Call contrail api here","info":"","comments":"","x":491.0477752685547,"y":1175.643006324768,"z":"5f90649b.a6618c","wires":[]},{"id":"228d2ac3.140ba6","type":"comment","name":"Rollback - rollback contrail/AAI","info":"","comments":"","x":1175.8573608398438,"y":1136.0477056503296,"z":"5f90649b.a6618c","wires":[]},{"id":"eb7db965.cffa68","type":"comment","name":"Create  network policy in AAI","info":"","comments":"","x":497.76202392578125,"y":1611.2262735366821,"z":"5f90649b.a6618c","wires":[]},{"id":"21f56f54.bd659","type":"save","name":"save AnAI - network-policy","xml":"<save plugin=\"org.onap.ccsdk.sli.adaptors.aai.AAIService\" \n\tresource=\"network-policy\" \n\t\tkey=\"network-policy.network-policy-id = $ar-assignments.contrail-id\" >\n<!-- Create l3-network object -->\n<parameter name=\"network-policy-id\" value=\"`$ar-assignments.contrail-id`\" />\n<parameter name=\"network-policy-fqdn\" value=\"`$ar-assignments.fq-name`\" />\n\n\n","comments":"","outputs":1,"x":513.1389083862305,"y":1648.2938385009766,"z":"5f90649b.a6618c","wires":[["52e636d7.8ebb58","ed317c2.86ca38"]]},{"id":"244a6c17.3e21d4","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"Failed to save network policy in AAI\" />\n","comments":"","x":985.4844169616699,"y":1638.575451850891,"z":"5f90649b.a6618c","wires":[]},{"id":"52e636d7.8ebb58","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":756.9130249023438,"y":1637.5911893844604,"z":"5f90649b.a6618c","wires":[["244a6c17.3e21d4"]]},{"id":"ed317c2.86ca38","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":760.7225227355957,"y":1667.06760597229,"z":"5f90649b.a6618c","wires":[["244a6c17.3e21d4"]]},{"id":"801bff7e.fbad5","type":"comment","name":"MDSal adaptor only saves consuming service so parent service and AR are done by Rest api calls","info":"","comments":"","x":613.6666259765625,"y":49.33332824707031,"z":"5f90649b.a6618c","wires":[]},{"id":"c191a157.b6674","type":"execute","name":"execute Contrail API create network policy","xml":"<execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >\n<parameter name='api-name' value='network-policy' />\n<parameter name='api-action' value='create' />\n<parameter name='resp-prefix' value='contrailResp' />\n<parameter name='default-domain' value='default-domain' />\n<parameter name='policy-name' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />\n<parameter name='default-project' value='`$tmp.ar.tenant-name`' /> \n<!-- dummy for dev <parameter name='default-project' value='default-project' /> -->\n<parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' />\n<parameter name='dst-virtual-network' value='`$aai.dest-network.contrail-network-fqdn`' />\n<parameter name='src-virtual-network' value='`$aai.src-network.contrail-network-fqdn`' />\n<parameter name='direction' value='&lt;&gt;' />\n<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />\n\n","comments":"","outputs":1,"x":552.0000915527344,"y":1291.8338508605957,"z":"5f90649b.a6618c","wires":[["7a90fc8f.31cf84","1476872f.65dcf9"]]},{"id":"7a90fc8f.31cf84","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":833.380973815918,"y":1259.976146850735,"z":"5f90649b.a6618c","wires":[["e7e4be16.a7a45"]]},{"id":"1476872f.65dcf9","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":831.4762954711914,"y":1292.976086616516,"z":"5f90649b.a6618c","wires":[["44b885c3.5934bc"]]},{"id":"df03f36f.1c4a","type":"switchNode","name":"switch source-network.network-id","xml":"<switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'>\n\n","comments":"","outputs":1,"x":554.0000457763672,"y":764.0001230239868,"z":"5f90649b.a6618c","wires":[["69c55b4f.8054f4","6060b3b1.b4008c"]]},{"id":"69c55b4f.8054f4","type":"other","name":"Other","xml":"<outcome value='Other'>","comments":"","outputs":1,"x":910.0002632141113,"y":762.6665024757385,"z":"5f90649b.a6618c","wires":[["74dfd12.49de63"]]},{"id":"6060b3b1.b4008c","type":"other","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":905.6670799255371,"y":725.6663026809692,"z":"5f90649b.a6618c","wires":[["1ff80c0f.023764"]]},{"id":"7a681aef.92f704","type":"for","name":"for nidx..service-data.networks.network[]","xml":"<for index='nidx' start='0' end='`$service-data.networks.network_length`' >\n","comments":"","outputs":1,"x":2045.4450378417969,"y":802.4442802667618,"z":"5f90649b.a6618c","wires":[["ddb4759b.c74ba8"]]},{"id":"58522d88.a159a4","type":"switchNode","name":"switch service-data.networks.network_length","xml":"<switch test='`$service-data.networks.network_length`'>\n","comments":"","outputs":1,"x":1301.825698852539,"y":762.6823296546936,"z":"5f90649b.a6618c","wires":[["a0f9f28f.3a11d","62f8d43d.6ff0ac"]]},{"id":"a0f9f28f.3a11d","type":"other","name":"outcome Null","xml":"<outcome value=''>\n","comments":"","outputs":1,"x":1590.825698852539,"y":764.6823906898499,"z":"5f90649b.a6618c","wires":[["6eb4b765.2bcfe8"]]},{"id":"62f8d43d.6ff0ac","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":1570.825698852539,"y":799.6823906898499,"z":"5f90649b.a6618c","wires":[["e7594b36.af86f8"]]},{"id":"e7594b36.af86f8","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1775.4290008544922,"y":803.5702644586563,"z":"5f90649b.a6618c","wires":[["7a681aef.92f704"]]},{"id":"74dfd12.49de63","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1044.1115188598633,"y":763.1109070777893,"z":"5f90649b.a6618c","wires":[["58522d88.a159a4"]]},{"id":"1ff80c0f.023764","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"Error assigning contrail route.  Source network not found\" />\n","comments":"","x":1059.8005447387695,"y":726.3332052230835,"z":"5f90649b.a6618c","wires":[]},{"id":"6eb4b765.2bcfe8","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"Error assigning contrail route.  Source network not found\" />\n","comments":"","x":1783.9337768554688,"y":764.9998508691788,"z":"5f90649b.a6618c","wires":[]},{"id":"7cbfe81d.55cd18","type":"comment","name":"Find tenant id/cloud region from source network","info":"","comments":"","x":591.4003677368164,"y":730.6664390563965,"z":"5f90649b.a6618c","wires":[]},{"id":"ddb4759b.c74ba8","type":"switchNode","name":"switch networkid found","xml":"<switch test=\"`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`\">\n\n","comments":"","outputs":1,"x":2337.9998474121094,"y":799.3334070444107,"z":"5f90649b.a6618c","wires":[["f4eec0e2.b336a","e74ffe1b.ee527"]]},{"id":"831dcdf8.8c4d9","type":"set","name":"set tmp vals","xml":"<set>\n<parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' />\n<parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />\n\n\n","comments":"","x":2877.666519165039,"y":789.3333841562271,"z":"5f90649b.a6618c","wires":[]},{"id":"1f3c5039.cf476","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":2687.732961654663,"y":802.3333956003189,"z":"5f90649b.a6618c","wires":[["831dcdf8.8c4d9","3e513116.e80b7e"]]},{"id":"f4eec0e2.b336a","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":2532.2663383483887,"y":802.3332582712173,"z":"5f90649b.a6618c","wires":[["1f3c5039.cf476"]]},{"id":"e74ffe1b.ee527","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":2533.065948486328,"y":840.3332611322403,"z":"5f90649b.a6618c","wires":[["cce762b8.5727a"]]},{"id":"cce762b8.5727a","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"Error assigning contrail route.  Source network not found\" />\n","comments":"","x":2711.066104888916,"y":840.3333269357681,"z":"5f90649b.a6618c","wires":[]},{"id":"3e513116.e80b7e","type":"get-resource","name":"get-resource tenant","xml":"<get-resource plugin=\"org.onap.ccsdk.sli.adaptors.aai.AAIService\" \n\t\tresource=\"tenant\" \n\t\tkey=\"cloud-region.cloud-owner = 'att-aic' AND \n\t\t     cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND\n\t\t     tenant.tenant-id = $tmp.ar.tenant-id\"\n        pfx='aai.tenant' local-only='false' >\n\n","comments":"","outputs":1,"x":2900.1330642700195,"y":825.3330799341202,"z":"5f90649b.a6618c","wires":[["dfe3bd23.975b8","7f907bb.cc18a84","324872c7.f43eee"]]},{"id":"dfe3bd23.975b8","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":3120.994453430176,"y":817.9441944360733,"z":"5f90649b.a6618c","wires":[["ddb43474.5e2fc8"]]},{"id":"7f907bb.cc18a84","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":3116.327480316162,"y":851.2775083780289,"z":"5f90649b.a6618c","wires":[["ddb43474.5e2fc8"]]},{"id":"ddb43474.5e2fc8","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"Tenant not found in AAI\" />\n\n","comments":"","x":3290.503402709961,"y":839.3330675363541,"z":"5f90649b.a6618c","wires":[]},{"id":"324872c7.f43eee","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":3116.503486633301,"y":786.370158791542,"z":"5f90649b.a6618c","wires":[["19595da5.86cf22"]]},{"id":"19595da5.86cf22","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":3296.503486633301,"y":784.370158791542,"z":"5f90649b.a6618c","wires":[["9bf595b1.bf70f8"]]},{"id":"9bf595b1.bf70f8","type":"set","name":"set tenant name","xml":"<set>\n<parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' />\n\n\n","comments":"","x":3483.4665908813477,"y":781.9999004602432,"z":"5f90649b.a6618c","wires":[]},{"id":"c6e8d07f.0b15c","type":"update","name":"update AAI allotted-resource","xml":"<update plugin=\"org.onap.ccsdk.sli.adaptors.aai.AAIService\" \n\t\tresource=\"allotted-resource\" \n\t\tkey=\"customer.global-customer-id = $service-data.service-information.global-customer-id AND\n\t\t\tservice-subscription.service-type = $service-data.service-information.subscription-service-type AND\n\t\t\tservice-instance.service-instance-id = $service-data.service-information.service-instance-id AND\n\t\t\tallotted-resource.id = $tmp.ar.allotted-resource-id\"\n        pfx='pfx' local-only='false' force='false'>\n\t<parameter name=\"operational-status\" value=\"out-of-service-path\" />\n","comments":"","outputs":1,"x":500.4287109375,"y":1747.6073377132416,"z":"5f90649b.a6618c","wires":[["4c9be32.4622c1c","58211de1.fa28b4"]]},{"id":"4c9be32.4622c1c","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":756.1906051635742,"y":1724.8455572128296,"z":"5f90649b.a6618c","wires":[["3ee10ac5.6c52d6"]]},{"id":"58211de1.fa28b4","type":"failure","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":761.5000343322754,"y":1760.4169750213623,"z":"5f90649b.a6618c","wires":[["3ee10ac5.6c52d6"]]},{"id":"3ee10ac5.6c52d6","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"AAI failed\" />\n","comments":"","x":971.2858200073242,"y":1726.4646015167236,"z":"5f90649b.a6618c","wires":[]},{"id":"a5f87574.e494f8","type":"comment","name":"Update AAI AR","info":"","comments":"","x":456.62871170043945,"y":1716.7500885389745,"z":"5f90649b.a6618c","wires":[]},{"id":"44b885c3.5934bc","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `\" />\n","comments":"","x":991.381103515625,"y":1292.309534072876,"z":"5f90649b.a6618c","wires":[]},{"id":"9525be20.92483","type":"record","name":"record","xml":"<record plugin=\"org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder\">\n<parameter name=\"logger\" value=\"message-log\"/>\n<parameter name=\"field1\" value=\"__TIMESTAMP__\"/>\n<parameter name=\"field2\" value=\"GENERIC-RESOURCE-API.contrail-route-topology-operation-create\"/>\n<parameter name='field3' value='network-policy' />\n<parameter name='field4' value='create' />\n<parameter name='field5' value='contrailResp' />\n<parameter name='field6' value='default-domain' />\n<parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />\n<parameter name='field8' value='`$tmp.ar.tenant-name`' />\n<parameter name='field9' value='`$ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn`' />\n<parameter name='field10' value='$aai.dest-network.contrail-network-fqdn' />\n<parameter name='field11' value='$aai.src-network.contrail-network-fqdn' />\n<parameter name='field12' value='&lt;&gt;' />\n<parameter name='field13' value='$tmp.ar.cloud-region-id' />\n\n\n","comments":"","outputs":1,"x":440.09527587890625,"y":1261.595251083374,"z":"5f90649b.a6618c","wires":[[]]},{"id":"c2b56ee4.19d0f","type":"not-found","name":"not found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":836.2857666015625,"y":841.9288463592529,"z":"5f90649b.a6618c","wires":[["a3daa790.c8f578"]]},{"id":"84f94150.403b","type":"get-resource","name":"get AnAI - l3-network by network-id","xml":"<get-resource plugin=\"org.onap.ccsdk.sli.adaptors.aai.AAIService\" \n\tresource=\"l3-network\" \n\t\tkey=\"l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id\" \n\t\tlocal-only=\"false\" \n\t\tpfx=\"aai.src-network\">\n","comments":"","outputs":1,"x":564.9126892089844,"y":849.4611072540283,"z":"5f90649b.a6618c","wires":[["d00661cb.d83c8","c2b56ee4.19d0f","bf39102b.a9daa"]]},{"id":"d00661cb.d83c8","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":829.0078735351562,"y":876.4134502410889,"z":"5f90649b.a6618c","wires":[["a3daa790.c8f578"]]},{"id":"a3daa790.c8f578","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name=\"error-code\" value=\"500\" />\n\t<parameter name=\"error-message\" value=\"`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`\" />","comments":"","x":981.1188354492188,"y":872.6356792449951,"z":"5f90649b.a6618c","wires":[]},{"id":"bf39102b.a9daa","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":834.2858276367188,"y":907.9288463592529,"z":"5f90649b.a6618c","wires":[["35e7e6d8.9c02fa"]]},{"id":"35e7e6d8.9c02fa","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":986.952392578125,"y":906.2621746063232,"z":"5f90649b.a6618c","wires":[[]]},{"id":"b5a6ae1.293715","type":"comment","name":"GET source network from AAI","info":"","comments":"","x":537.7143249511719,"y":817.6430835723877,"z":"5f90649b.a6618c","wires":[]},{"id":"4c2c7cf4.617bb4","type":"not-found","name":"not found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":840.5714721679688,"y":949.0716209411621,"z":"5f90649b.a6618c","wires":[["9036f2cc.f4b7d"]]},{"id":"674f14d2.772d8c","type":"get-resource","name":"get AnAI - l3-network by network-id","xml":"<get-resource plugin=\"org.onap.ccsdk.sli.adaptors.aai.AAIService\" \n\tresource=\"l3-network\" \n\t\tkey=\"l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id\" \n\t\tlocal-only=\"false\" \n\t\tpfx=\"aai.dest-network\">\n","comments":"","outputs":1,"x":569.1983947753906,"y":956.6038818359375,"z":"5f90649b.a6618c","wires":[["946c94f2.2a45a8","4c2c7cf4.617bb4","e5db03f9.2fafe"]]},{"id":"946c94f2.2a45a8","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":833.2935791015625,"y":983.556224822998,"z":"5f90649b.a6618c","wires":[["9036f2cc.f4b7d"]]},{"id":"9036f2cc.f4b7d","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name=\"error-code\" value=\"500\" />\n\t<parameter name=\"error-message\" value=\"`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`\" />","comments":"","x":985.404541015625,"y":979.7784538269043,"z":"5f90649b.a6618c","wires":[]},{"id":"e5db03f9.2fafe","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":833.571533203125,"y":1020.0715923309326,"z":"5f90649b.a6618c","wires":[["854d69a8.a38398"]]},{"id":"854d69a8.a38398","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":986.2380981445312,"y":1018.4049205780029,"z":"5f90649b.a6618c","wires":[[]]},{"id":"3714bcdd.1c2684","type":"comment","name":"GET dest network from AAI","info":"","comments":"","x":542.0000305175781,"y":924.7858581542969,"z":"5f90649b.a6618c","wires":[]},{"id":"14b73b46.6d9fb5","type":"set","name":"set temp contrail fqdn for input to contrail","xml":"<set>\n<parameter name='aai.src-network.contrail-network-fqdn' value='`tmpsourcecontrailfqdn`' />\n<parameter name='aai.dest-network.contrail-network-fqdn' value='`tmpdestinationcontrailfqdn`' />","comments":"","x":575.0000648498535,"y":1106.928747177124,"z":"5f90649b.a6618c","wires":[]},{"id":"e7e4be16.a7a45","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":985.5714569091797,"y":1260.6428718566895,"z":"5f90649b.a6618c","wires":[[]]},{"id":"dcc82b6d.bd0448","type":"set","name":"set ar-assignments","xml":"<set>\n<parameter name='ar-assignments.' value=\"`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`\" />\n\n\n\n","comments":"","x":516.2857627868652,"y":588.5714883804321,"z":"5f90649b.a6618c","wires":[]},{"id":"3fc1cd7b.ce8842","type":"set","name":"set ar-assignments","xml":"<set>\n<parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.' value='`$ar-assignments.`' />\n\n\n\n","comments":"","x":463.42869567871094,"y":1807.607406616211,"z":"5f90649b.a6618c","wires":[]},{"id":"7ce279cd.dfcc18","type":"switchNode","name":"switch contrailResp.resp-code","xml":"<switch test='`$contrailResp.resp-code`'>\n\n","comments":"","outputs":1,"x":518.607177734375,"y":1357.2500972747803,"z":"5f90649b.a6618c","wires":[["d4c93b29.23d048","dcc6b0f9.993d7"]]},{"id":"d4c93b29.23d048","type":"outcome","name":"outcome 0","xml":"<outcome value='0'>\n","comments":"","outputs":1,"x":795.7501801252365,"y":1357.2502279281616,"z":"5f90649b.a6618c","wires":[["43219c8b.d04894"]]},{"id":"dcc6b0f9.993d7","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":775.7500915527344,"y":1384.7501316070557,"z":"5f90649b.a6618c","wires":[["62b65f6a.fbc85"]]},{"id":"62b65f6a.fbc85","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `\" />\n","comments":"","x":948.2501907348633,"y":1387.2502298355103,"z":"5f90649b.a6618c","wires":[]},{"id":"43219c8b.d04894","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":940.7500915527344,"y":1357.250129699707,"z":"5f90649b.a6618c","wires":[[]]},{"id":"b1b62e5b.66cdc","type":"comment","name":"Dummy values for dev/dev","info":"","comments":"","x":522.0000114440918,"y":1070.0002274513245,"z":"5f90649b.a6618c","wires":[]},{"id":"fa1647e6.8bb8f8","type":"call","name":"call policy-manager-create-policy","xml":"<call module='GENERIC-RESOURCE-API' rpc='policy-manager-create-policy' mode='sync' >\n","comments":"","outputs":1,"x":537.1427841186523,"y":1491.4284505844116,"z":"5f90649b.a6618c","wires":[["4134066.d0e53f8","cfa986c.9649d78"]]},{"id":"4134066.d0e53f8","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":772.7221450805664,"y":1488.7704181671143,"z":"5f90649b.a6618c","wires":[["6336a3da.11edec"]]},{"id":"cfa986c.9649d78","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":778.714412689209,"y":1529.5714936256409,"z":"5f90649b.a6618c","wires":[["f41f6acc.efb3a8"]]},{"id":"f41f6acc.efb3a8","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":931.3809776306152,"y":1527.9048218727112,"z":"5f90649b.a6618c","wires":[[]]},{"id":"2d6f6d8d.fcc1b2","type":"execute","name":"execute Contrail API delete network policy","xml":"<execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >\n<parameter name='api-name' value='network-policy' />\n<parameter name='api-action' value='delete' />\n<parameter name='resp-prefix' value='contrailResp' />\n<parameter name='default-domain' value='default-domain' />\n<parameter name='policy-name' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />\n<parameter name='default-project' value='`$tmp.ar.tenant-name`' /> \n<!-- dummy for dev <parameter name='default-project' value='default-project' /> -->\n<parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' />\n<parameter name='dst-virtual-network' value='`$aai.dest-network.contrail-network-fqdn`' />\n<parameter name='src-virtual-network' value='`$aai.src-network.contrail-network-fqdn`' />\n<parameter name='direction' value='&lt;&gt;' />\n<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />\n\n","comments":"","outputs":1,"x":1225.7143249511719,"y":1487.1428270339966,"z":"5f90649b.a6618c","wires":[["cd2ace54.7c12e","4fd4dcde.514ad4"]]},{"id":"cd2ace54.7c12e","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1502.809471130371,"y":1456.7137071229517,"z":"5f90649b.a6618c","wires":[["c111c6b8.837068"]]},{"id":"4fd4dcde.514ad4","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1500.9047927856445,"y":1489.713646888733,"z":"5f90649b.a6618c","wires":[["704a5361.3555ec"]]},{"id":"704a5361.3555ec","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"`'Failed to create Policy in Policy Mgr.  Rollback failed to delete policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `\" />\n","comments":"","x":1660.8096008300781,"y":1487.0470943450928,"z":"5f90649b.a6618c","wires":[]},{"id":"c111c6b8.837068","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1654.9999542236328,"y":1457.3804321289062,"z":"5f90649b.a6618c","wires":[[]]},{"id":"6336a3da.11edec","type":"block","name":"block: atomic","xml":"<block atomic=\"true\">\n","atomic":"false","comments":"","outputs":1,"x":931.4285888671875,"y":1482.857177734375,"z":"5f90649b.a6618c","wires":[["2d6f6d8d.fcc1b2","15d27925.63edf7"]]},{"id":"15d27925.63edf7","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"`'Failed to create policy in PolicyMgr. '+ $error-message  + 'Contrail network policy rolled back.'`\" />\n","comments":"","x":1129.9999771118164,"y":1527.142939567566,"z":"5f90649b.a6618c","wires":[]}]