{ "version": "3.0", "name": "next vlan", "comment": "assign next vlan", "type": "REST_EVENT", "event_type": [ "NETWORK_IPV4" ], "action_type": "assign next vlan", "content_type": "application/json", "vendor_identifier": "NIOS WAPI v2.7", "quoting": "XML", "steps": [ { "name": "stop if a delete", "operation": "CONDITION", "condition": { "condition_type": "AND", "statements": [ { "left": "${E:A:operation_type}", "op": "==", "right": "DELETE" } ], "stop": true } }, { "name": "stop if no EA flag", "operation": "CONDITION", "condition": { "condition_type": "AND", "statements": [ { "left": "${E:A:values{extattrs}{Assign_VLAN}{value}}", "op": "!=", "right": "TRUE" } ], "stop": true } }, { "name": "remove vlan flag EA", "operation": "PUT", "transport": { "path": "${E:A:values{_ref}}" }, "wapi": "v2.7", "body": "{ \"extattrs-\": { \"Assign_VLAN\": { } } }" }, { "name": "check remove vlan flag EA was successful", "operation": "CONDITION", "condition": { "condition_type": "OR", "statements": [ { "left": "${R::RC}", "op": "!=", "right": "200" } ], "stop": true } }, { "name": "get v6 net associated with site", "operation": "GET", "transport": { "path": "ipv6network?_return_type=xml&_return_fields%2B=extattrs&_max_results=1&network_container=2001:db8::/32&*Site:=${E:A:values{extattrs}{Site}{value}}" }, "parse": "XML" }, { "name": "increment vlan number and store v6 net reference", "operation": "NOP", "body_list": [ "${XC:COPY:{L:VLANnum}:{P:list{value}{extattrs}{VLAN_Number}{value}}}", "${XC:INC:{L:VLANnum}}", "${XC:COPY:{L:v6netRef}:{P:list{value}{_ref}}}" ] }, { "name": "check get v6 net successful", "operation": "CONDITION", "condition": { "condition_type": "OR", "statements": [ { "left": "${R::RC}", "op": "!=", "right": "200" } ], "stop": true } }, { "name": "add vlan number EA", "operation": "PUT", "transport": { "path": "${E:A:values{_ref}}" }, "wapi": "v2.7", "body": "{ \"extattrs+\": { \"VLAN_Number\": { \"value\": \"${L::VLANnum}\" } } }" }, { "name": "check add vlan EA was successful", "operation": "CONDITION", "condition": { "condition_type": "OR", "statements": [ { "left": "${R::RC}", "op": "!=", "right": "200" } ], "stop": true } }, { "name": "update vlan number on v6 net", "operation": "PUT", "transport": { "path": "${L::v6netRef}" }, "wapi": "v2.7", "body": "{ \"extattrs+\": { \"VLAN_Number\": { \"value\": \"${L::VLANnum}\" } } }" }, { "name": "check update vlan number on v6 net successful", "operation": "CONDITION", "condition": { "condition_type": "OR", "statements": [ { "left": "${R::RC}", "op": "!=", "right": "200" } ], "stop": true } } ] }