aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.json
blob: 71d1caca3f542e57158678c1ed535f8dee517934 (plain)
1
[{"id":"6f42193e.7fcb18","type":"dgstart","name":"DGSTART","outputs":1,"x":182,"y":96,"z":"9d85256.794bfd8","wires":[["3a9d923a.4687de"]]},{"id":"3a9d923a.4687de","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":328.2380828857422,"y":170.95239353179932,"z":"9d85256.794bfd8","wires":[["1dd7e766.22b889"]]},{"id":"1dd7e766.22b889","type":"method","name":"contrail-route-topology-operation-deactivate","xml":"<method rpc='contrail-route-topology-operation-deactivate' mode='sync'>\n","comments":"","outputs":1,"x":408.1548500061035,"y":240.1904420852661,"z":"9d85256.794bfd8","wires":[["5b6f8915.4550d8"]]},{"id":"5b6f8915.4550d8","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","comments":"","outputs":1,"x":316.4761848449707,"y":383.523784160614,"z":"9d85256.794bfd8","wires":[["38d86f0b.67968","122583d8.1d260c","feae2ef.c5154d","cc085949.e3c218","9d38854d.1bb8b8","2829196a.eaaa76","8d33f3ff.44af3","c5fcedfe.366e1","a2b2b115.328ef","6975ce5b.c1d44","dca3aceb.03885","6578d3d4.5476dc","9376585b.91de78","98d3d9af.b219d8","b42adb13.7a13e8","d0cfc654.944c28","cbccf77c.4013d8","e468068e.f8fd78","3eceb01b.795e6","4fb1ccbe.de9264","8edbb4f5.1da278","4619cd3d.096d04"]]},{"id":"122583d8.1d260c","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":579.000072479248,"y":2309.548008918762,"z":"9d85256.794bfd8","wires":[]},{"id":"38d86f0b.67968","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":607.753978729248,"y":2272.0038022994995,"z":"9d85256.794bfd8","wires":[]},{"id":"6975ce5b.c1d44","type":"set","name":"set allotted-resource-oper-status","xml":"<set>\n<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />\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":642.7541427612305,"y":2132.7179613113403,"z":"9d85256.794bfd8","wires":[]},{"id":"cc085949.e3c218","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":578.7380561828613,"y":357.3333215713501,"z":"9d85256.794bfd8","wires":[]},{"id":"feae2ef.c5154d","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<parameter name='tmp.ar.sz-vnf-id' value='`$contrail-route-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />\n\n\n","comments":"","x":625.9973182678223,"y":323.5925874710083,"z":"9d85256.794bfd8","wires":[]},{"id":"9d38854d.1bb8b8","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":648.9934158325195,"y":393.2315502166748,"z":"9d85256.794bfd8","wires":[[]]},{"id":"8d33f3ff.44af3","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":655.5187454223633,"y":561.459508895874,"z":"9d85256.794bfd8","wires":[["ef8e221b.d195c","c49c58ea.301828"]]},{"id":"2829196a.eaaa76","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":613.0648460388184,"y":453.01722526550293,"z":"9d85256.794bfd8","wires":[[]]},{"id":"ef8e221b.d195c","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":900.8148498535156,"y":562.2673225402832,"z":"9d85256.794bfd8","wires":[["70fd0b18.96fdf4"]]},{"id":"c5fcedfe.366e1","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":670.8626098632812,"y":2206.7674808502197,"z":"9d85256.794bfd8","wires":[["4700a122.f4dac","36986bb9.23cbc4","460b74b4.c2c05c"]]},{"id":"4700a122.f4dac","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":941.1706275939941,"y":2259.7656816467643,"z":"9d85256.794bfd8","wires":[["36e7add1.93abd2"]]},{"id":"36986bb9.23cbc4","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":932.1706771850586,"y":2228.265707395971,"z":"9d85256.794bfd8","wires":[["36e7add1.93abd2"]]},{"id":"460b74b4.c2c05c","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":935.9207153320312,"y":2198.622812271118,"z":"9d85256.794bfd8","wires":[["5404b4c7.e2032c"]]},{"id":"36e7add1.93abd2","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":1101.9207153320312,"y":2229.0157312378287,"z":"9d85256.794bfd8","wires":[]},{"id":"70fd0b18.96fdf4","type":"block","name":"block: atomic","xml":"<block atomic=\"true\">\n","atomic":"false","comments":"","outputs":1,"x":1069.814853668213,"y":560.7672233581543,"z":"9d85256.794bfd8","wires":[["b8f11906.dba3b8"]]},{"id":"b8f11906.dba3b8","type":"switchNode","name":"switch cr length","xml":"<switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>\n","comments":"","outputs":1,"x":1280.6720962524414,"y":560.3863525390625,"z":"9d85256.794bfd8","wires":[["9b410254.194e9","33e90ef6.f223c2"]]},{"id":"9b410254.194e9","type":"other","name":"outcome 1","xml":"<outcome value='1'>\n","comments":"","outputs":1,"x":1470.0054016113281,"y":560.3863105773926,"z":"9d85256.794bfd8","wires":[["15bf006b.a87d5"]]},{"id":"f9f3fdcd.0ab34","type":"set","name":"set ar from get","xml":"<set>\n<parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />\n","comments":"","x":1943.1962203979492,"y":523.6245260238647,"z":"9d85256.794bfd8","wires":[]},{"id":"15bf006b.a87d5","type":"block","name":"block: atomic","xml":"<block atomic='true'>\n","atomic":"false","comments":"","outputs":1,"x":1654.529291152954,"y":557.2911443710327,"z":"9d85256.794bfd8","wires":[["f9f3fdcd.0ab34","e7cd0298.e8dcc","bba9d10e.349f9"]]},{"id":"e7cd0298.e8dcc","type":"set","name":"set oper-status","xml":"<set>\n<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />\n<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />\n<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />\n\n","comments":"","x":1951.1961479187012,"y":587.719669342041,"z":"9d85256.794bfd8","wires":[]},{"id":"2bf64ead.e3bc32","type":"comment","name":"GET security-zone-allotted-resource from mdsal","info":"","comments":"","x":668.8147926330566,"y":528.7672119140625,"z":"9d85256.794bfd8","wires":[]},{"id":"93e5a3ab.9544a","type":"switchNode","name":"switch order-status","xml":"<switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>\n","comments":"","outputs":1,"x":1959.196002960205,"y":554.6244812011719,"z":"9d85256.794bfd8","wires":[["9b9adb79.d81988","d559dc4.b4c922"]]},{"id":"9b9adb79.d81988","type":"outcome","name":"outcome Other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":2194.8436737060547,"y":569.0531902313232,"z":"9d85256.794bfd8","wires":[["d622bf5.875044"]]},{"id":"d622bf5.875044","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\" \n    value=\"`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`\" />\n","comments":"","x":2435.462423324585,"y":571.9577798843384,"z":"9d85256.794bfd8","wires":[]},{"id":"6578d3d4.5476dc","type":"set","name":"unset ar-assignments.vlan-tag","xml":"<set>\n<parameter name='ar-assignments.vlan-tag' value=\"\" />\n\n\n\n","comments":"","x":616.862419128418,"y":1670.0531845092773,"z":"9d85256.794bfd8","wires":[]},{"id":"bba9d10e.349f9","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":2031.0532722473145,"y":490.4340181350708,"z":"9d85256.794bfd8","wires":[]},{"id":"7d4ef2a7.fd27ec","type":"comment","name":"Create urls for restapi","info":"","comments":"","x":583.9576530456543,"y":422.62435245513916,"z":"9d85256.794bfd8","wires":[]},{"id":"5404b4c7.e2032c","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1077.5766830444336,"y":2194.8149814605713,"z":"9d85256.794bfd8","wires":[[]]},{"id":"a2b2b115.328ef","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":593.5767288208008,"y":2099.1481199264526,"z":"9d85256.794bfd8","wires":[[]]},{"id":"ba60bed0.88369","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":1653.666997909546,"y":673.3333854675293,"z":"9d85256.794bfd8","wires":[]},{"id":"c49c58ea.301828","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":892.6666526794434,"y":597.3334074020386,"z":"9d85256.794bfd8","wires":[["25ba4dc1.5132b2"]]},{"id":"25ba4dc1.5132b2","type":"block","name":"block: atomic","xml":"<block atomic=\"true\">\n","atomic":"false","comments":"","outputs":1,"x":1072.666603088379,"y":597.9999580383301,"z":"9d85256.794bfd8","wires":[["ba60bed0.88369"]]},{"id":"dca3aceb.03885","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":564.666618347168,"y":593.6666221618652,"z":"9d85256.794bfd8","wires":[]},{"id":"33e90ef6.f223c2","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":1458.3333549499512,"y":597.6666707992554,"z":"9d85256.794bfd8","wires":[["ba60bed0.88369"]]},{"id":"41d0055a.f5d40c","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":2419.333469390869,"y":537.6666975021362,"z":"9d85256.794bfd8","wires":[[]]},{"id":"1e0333e0.bb844c","type":"comment","name":"Call contrail api here","info":"","comments":"","x":594.8571243286133,"y":660.2857151031494,"z":"9d85256.794bfd8","wires":[]},{"id":"5db846ef.38ec08","type":"comment","name":"Need to rollback aai here","info":"","comments":"","x":1327.9999771118164,"y":2228.3333263397217,"z":"9d85256.794bfd8","wires":[]},{"id":"48ad7bf5.74a014","type":"comment","name":"Create  network policy in AAI","info":"","comments":"","x":627.333251953125,"y":2048.3332138061523,"z":"9d85256.794bfd8","wires":[]},{"id":"d559dc4.b4c922","type":"outcome","name":"outcome Active","xml":"<outcome value='Active'>\n","comments":"","outputs":1,"x":2209.6053161621094,"y":537.2912015914917,"z":"9d85256.794bfd8","wires":[["41d0055a.f5d40c"]]},{"id":"9376585b.91de78","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":615.3333129882812,"y":1826.6666622161865,"z":"9d85256.794bfd8","wires":[["5f9fa013.45a14","1dfd3b63.382635"]]},{"id":"5f9fa013.45a14","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":871.0952453613281,"y":1803.904836654663,"z":"9d85256.794bfd8","wires":[["e7c07e31.eaec"]]},{"id":"1dfd3b63.382635","type":"failure","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":876.4046745300293,"y":1839.4762544631958,"z":"9d85256.794bfd8","wires":[["e7c07e31.eaec"]]},{"id":"e7c07e31.eaec","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":1086.1904602050781,"y":1805.5238809585571,"z":"9d85256.794bfd8","wires":[]},{"id":"a91079be.620158","type":"comment","name":"Update AAI AR","info":"","comments":"","x":578.6761703491211,"y":1790.095106124878,"z":"9d85256.794bfd8","wires":[]},{"id":"98d3d9af.b219d8","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":593,"y":626,"z":"9d85256.794bfd8","wires":[]},{"id":"d67ce795.d438a8","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":1639.571683883667,"y":772.6666259765625,"z":"9d85256.794bfd8","wires":[]},{"id":"95b2d8a8.b95fe8","type":"not-found","name":"not found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":893.1903457641602,"y":926.0476361513138,"z":"9d85256.794bfd8","wires":[["587d3201.9d2dec"]]},{"id":"d0cfc654.944c28","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":616.3886871337891,"y":937.294153213501,"z":"9d85256.794bfd8","wires":[["27df97d8.1b3568","95b2d8a8.b95fe8","ff40702c.ccb5a"]]},{"id":"27df97d8.1b3568","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":885.9124526977539,"y":960.5322400331497,"z":"9d85256.794bfd8","wires":[["587d3201.9d2dec"]]},{"id":"587d3201.9d2dec","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":1038.0234146118164,"y":956.754469037056,"z":"9d85256.794bfd8","wires":[]},{"id":"ff40702c.ccb5a","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":891.1904067993164,"y":992.0476361513138,"z":"9d85256.794bfd8","wires":[["71fad46f.afcc4c"]]},{"id":"71fad46f.afcc4c","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1043.8569717407227,"y":990.3809643983841,"z":"9d85256.794bfd8","wires":[[]]},{"id":"5c5f3058.c0223","type":"comment","name":"GET source network from AAI","info":"","comments":"","x":594.6189041137695,"y":906.0476303100586,"z":"9d85256.794bfd8","wires":[]},{"id":"4cfc272e.3ba048","type":"not-found","name":"not found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":910.9046859741211,"y":1189.7619500160217,"z":"9d85256.794bfd8","wires":[["a32dd432.848348"]]},{"id":"4fb1ccbe.de9264","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":639.531608581543,"y":1197.2942109107971,"z":"9d85256.794bfd8","wires":[["dc427390.11d98","4cfc272e.3ba048","3deff125.68148e"]]},{"id":"dc427390.11d98","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":903.6267929077148,"y":1224.2465538978577,"z":"9d85256.794bfd8","wires":[["a32dd432.848348"]]},{"id":"a32dd432.848348","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":1055.7377548217773,"y":1220.468782901764,"z":"9d85256.794bfd8","wires":[]},{"id":"3deff125.68148e","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":913.4761962890625,"y":1258.6190185546875,"z":"9d85256.794bfd8","wires":[["9214480a.91e1e8"]]},{"id":"9214480a.91e1e8","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1066.1427612304688,"y":1256.9523468017578,"z":"9d85256.794bfd8","wires":[[]]},{"id":"2a49204d.cef83","type":"comment","name":"GET dest network from AAI","info":"","comments":"","x":612.3332290649414,"y":1165.4762029647827,"z":"9d85256.794bfd8","wires":[]},{"id":"cbccf77c.4013d8","type":"set","name":"set policy fq-name","xml":"<set>\n<parameter name='tmp.fq-name' value=\"`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name` \" />\n","comments":"","x":565.3333129882812,"y":983.1903915405273,"z":"9d85256.794bfd8","wires":[]},{"id":"e468068e.f8fd78","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":627.327995300293,"y":1017.2802391052246,"z":"9d85256.794bfd8","wires":[]},{"id":"3eceb01b.795e6","type":"execute","name":"execute Contrail API apply network policy to source network","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='remove' />\n<parameter name='resp-prefix' value='contrailResp' />\n<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />\n<parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />\n<parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />\n<parameter name='contrail-virtual-network-id' value='`$aai.src-network.contrail-network-fqdn`' />\n\n","comments":"","outputs":1,"x":703.5185165405273,"y":1090.2804369926453,"z":"9d85256.794bfd8","wires":[["701abbd2.7e3b54","94120abf.4d0b08"]]},{"id":"701abbd2.7e3b54","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1059.1850128173828,"y":1090.7086639404297,"z":"9d85256.794bfd8","wires":[["dcb9ff58.45886"]]},{"id":"94120abf.4d0b08","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1057.2803344726562,"y":1123.7086037062109,"z":"9d85256.794bfd8","wires":[["a24bc0fc.7cfa4"]]},{"id":"a24bc0fc.7cfa4","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 remove policy in Contrail from source network\" />\n","comments":"","x":1217.1851043701172,"y":1123.0419702529907,"z":"9d85256.794bfd8","wires":[]},{"id":"dcb9ff58.45886","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1211.3754959106445,"y":1091.3753889463842,"z":"9d85256.794bfd8","wires":[[]]},{"id":"b42adb13.7a13e8","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":619.9046859741211,"y":862.3332405090332,"z":"9d85256.794bfd8","wires":[["5424210d.1c802","971927f5.16bf58"]]},{"id":"5424210d.1c802","type":"other","name":"Other","xml":"<outcome value='Other'>","comments":"","outputs":1,"x":975.9049034118652,"y":860.9996199607849,"z":"9d85256.794bfd8","wires":[["e39e1e1a.7ac94"]]},{"id":"971927f5.16bf58","type":"other","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":971.571720123291,"y":823.9994201660156,"z":"9d85256.794bfd8","wires":[["4f4a92a0.e38f1c"]]},{"id":"b98ee4e8.38eb78","type":"switchNode","name":"switch service-data.networks.network_length","xml":"<switch test='`$service-data.networks.network_length`'>\n","comments":"","outputs":1,"x":1367.730339050293,"y":861.01544713974,"z":"9d85256.794bfd8","wires":[["f9657d22.1dd65","c9ebc8c2.c7d948"]]},{"id":"f9657d22.1dd65","type":"other","name":"outcome Null","xml":"<outcome value=''>\n","comments":"","outputs":1,"x":1656.730339050293,"y":863.0155081748962,"z":"9d85256.794bfd8","wires":[["839cc49f.136208"]]},{"id":"c9ebc8c2.c7d948","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":1636.730339050293,"y":898.0155081748962,"z":"9d85256.794bfd8","wires":[["16bca9c2.7dc4c6"]]},{"id":"e39e1e1a.7ac94","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1110.0161590576172,"y":861.4440245628357,"z":"9d85256.794bfd8","wires":[["b98ee4e8.38eb78"]]},{"id":"4f4a92a0.e38f1c","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 activating contrail route.  Source network not found\" />\n","comments":"","x":1125.7051849365234,"y":824.6663227081299,"z":"9d85256.794bfd8","wires":[]},{"id":"95f9228a.7f106","type":"comment","name":"Find tenant id/cloud region from source network","info":"","comments":"","x":657.3050079345703,"y":828.9995565414429,"z":"9d85256.794bfd8","wires":[]},{"id":"c66b5efd.1ec84","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":2099.9047470092773,"y":898.3332633972168,"z":"9d85256.794bfd8","wires":[["f15b62ec.d4784"]]},{"id":"16bca9c2.7dc4c6","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1825.888786315918,"y":898.4592633247375,"z":"9d85256.794bfd8","wires":[["c66b5efd.1ec84"]]},{"id":"839cc49f.136208","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 activating contrail route.  Source network not found\" />\n","comments":"","x":1838.3934860229492,"y":862.8888339996338,"z":"9d85256.794bfd8","wires":[]},{"id":"f15b62ec.d4784","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":2392.45955657959,"y":895.2223901748657,"z":"9d85256.794bfd8","wires":[["20466326.cc228c","e3af7381.016dd"]]},{"id":"ca02674e.84b438","type":"set","name":"set tenantid and cloud region id","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":2980.1261596679688,"y":885.2223739624023,"z":"9d85256.794bfd8","wires":[]},{"id":"8017154b.206ea8","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":2742.1926708221436,"y":898.2223787307739,"z":"9d85256.794bfd8","wires":[["ca02674e.84b438","b9dd247f.268ab8"]]},{"id":"20466326.cc228c","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":2586.726047515869,"y":898.2222414016724,"z":"9d85256.794bfd8","wires":[["8017154b.206ea8"]]},{"id":"e3af7381.016dd","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":2587.5256576538086,"y":936.2222442626953,"z":"9d85256.794bfd8","wires":[["5a94e0ce.bbd29"]]},{"id":"5a94e0ce.bbd29","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 activating contrail route.  Source network not found\" />\n","comments":"","x":2765.5258140563965,"y":936.2223100662231,"z":"9d85256.794bfd8","wires":[]},{"id":"b9dd247f.268ab8","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":2954.5927734375,"y":921.2220630645752,"z":"9d85256.794bfd8","wires":[["dd7ba10c.161b9","cbf42233.390d7","866c3c16.228b3"]]},{"id":"dd7ba10c.161b9","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":3191.4541015625,"y":935.8331546783447,"z":"9d85256.794bfd8","wires":[["6068b4e5.0f7b2c"]]},{"id":"cbf42233.390d7","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":3186.7871284484863,"y":969.1664686203003,"z":"9d85256.794bfd8","wires":[["6068b4e5.0f7b2c"]]},{"id":"6068b4e5.0f7b2c","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":3360.963050842285,"y":957.2220277786255,"z":"9d85256.794bfd8","wires":[]},{"id":"866c3c16.228b3","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":3186.963134765625,"y":904.2591190338135,"z":"9d85256.794bfd8","wires":[["f29d601d.cb81d"]]},{"id":"f29d601d.cb81d","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":3366.963134765625,"y":902.2591190338135,"z":"9d85256.794bfd8","wires":[["2300be73.7c54a2"]]},{"id":"2300be73.7c54a2","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":3553.926239013672,"y":899.8888607025146,"z":"9d85256.794bfd8","wires":[]},{"id":"4c6f65c8.0d26bc","type":"comment","name":"Apply the policy to source network","info":"","comments":"","x":621.9047012329102,"y":1058.3332691192627,"z":"9d85256.794bfd8","wires":[]},{"id":"8edbb4f5.1da278","type":"execute","name":"execute Contrail API apply network policy to destination network","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='remove' />\n<parameter name='resp-prefix' value='contrailResp' />\n<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />\n<parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />\n<parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />\n<parameter name='contrail-virtual-network-id' value='`$aai.dest-network.contrail-network-fqdn`' />\n\n","comments":"","outputs":1,"x":727.9047470092773,"y":1342.3332767486572,"z":"9d85256.794bfd8","wires":[["40503601.fe4738","90fb633f.f3b86"]]},{"id":"40503601.fe4738","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1063.5711822509766,"y":1342.7614674568176,"z":"9d85256.794bfd8","wires":[["a824091b.d45238"]]},{"id":"90fb633f.f3b86","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1061.66650390625,"y":1375.7614072225988,"z":"9d85256.794bfd8","wires":[["a6d7eb4e.7a67a8"]]},{"id":"a6d7eb4e.7a67a8","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 remove policy in Contrail from dest network\" />\n","comments":"","x":1221.571273803711,"y":1375.0947737693787,"z":"9d85256.794bfd8","wires":[]},{"id":"a824091b.d45238","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1215.7616653442383,"y":1343.4281924627721,"z":"9d85256.794bfd8","wires":[[]]},{"id":"53b61fa1.1416d","type":"comment","name":"Apply the policy to dest network","info":"","comments":"","x":626.2908706665039,"y":1310.3860726356506,"z":"9d85256.794bfd8","wires":[]},{"id":"f68288a2.a88758","type":"comment","name":"Update network policy in AAI - relationship to networks","info":"","comments":"","x":689.9047546386719,"y":1452.3332481384277,"z":"9d85256.794bfd8","wires":[]},{"id":"4619cd3d.096d04","type":"save","name":"delete AnAI - network-policy relationship to source/dest network","xml":"<delete plugin=\"org.onap.ccsdk.sli.adaptors.aai.AAIService\" \n\tresource=\"network-policy:relationship-list\" \n\tkey=\"network-policy.network-policy-id = $ar-assignments.contrail-id and related-to = 'l3-network' \" >\n\n\n\n","comments":"","outputs":1,"x":727.2816619873047,"y":1485.4009227752686,"z":"9d85256.794bfd8","wires":[["c2ba7845.aba188","9531a4a4.802f48"]]},{"id":"d37f50f9.c5788","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":1275.6271018981934,"y":1479.6824353933334,"z":"9d85256.794bfd8","wires":[]},{"id":"c2ba7845.aba188","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1047.0557098388672,"y":1482.6981729269028,"z":"9d85256.794bfd8","wires":[["d37f50f9.c5788"]]},{"id":"9531a4a4.802f48","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":1050.8652076721191,"y":1512.1745895147324,"z":"9d85256.794bfd8","wires":[["d37f50f9.c5788"]]}]