fixed ET find and corrected validation code
This commit is contained in:
parent
1306b1bdfe
commit
f54792e117
|
@ -70,8 +70,8 @@
|
||||||
"taskReferenceName" : "extract_infrastructure_id",
|
"taskReferenceName" : "extract_infrastructure_id",
|
||||||
"type" : "SIMPLE",
|
"type" : "SIMPLE",
|
||||||
"inputParameters" : {
|
"inputParameters" : {
|
||||||
"code" : "exec('import xml.etree.ElementTree as ET') or list(map(lambda n: n.text, ET.fromstring(data['xmlstring']).findall('Resource[Profile/SecondaryType = \"INFRASTRUCTURE\"]/ID')))",
|
"code" : "exec('import xml.etree.ElementTree as ET') or list(map(lambda n: n.text, ET.fromstring(data['xmlstring']).findall('Resource/Profile/[SecondaryType=\\'INFRASTRUCTURE\\'][Name=\\'VirtualOrganisation\\']/../ID')))",
|
||||||
"xmlstring" : "${retrieve_vre.output.body}"
|
"xmlstring" : "${retrieve_infrastructure.output.body}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -130,9 +130,9 @@
|
||||||
"name": "LAMBDA_TASK",
|
"name": "LAMBDA_TASK",
|
||||||
"taskReferenceName": "check",
|
"taskReferenceName": "check",
|
||||||
"inputParameters": {
|
"inputParameters": {
|
||||||
"vre": "${extract_vre_id.output.result}",
|
"vre": "${extract_vre_id.output.result[0]}",
|
||||||
"infra": "${extract_vre_id.output.result}",
|
"infra": "${extract_infrastructure_id.output.result[0]}",
|
||||||
"scriptExpression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))} if(e($.vre) || e($.infra)) throw('VRE ID and Infra ID must not be empty'); var tree = $.ctx.split('%2F'); return { child : tree[tree.length - 1], parent : tree[tree.length-2], decoded_root_vo : $.root_vo.replace('%2F', '/') }"
|
"scriptExpression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))} if(e($.vre) || e($.infra)) throw('VRE ID and Infra ID must not be empty'); {}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -156,7 +156,7 @@
|
||||||
"name": "pyrest",
|
"name": "pyrest",
|
||||||
"taskReferenceName": "write_to_is",
|
"taskReferenceName": "write_to_is",
|
||||||
"inputParameters": {
|
"inputParameters": {
|
||||||
"url": "https://en5ql62qrka7q.x.pipedream.net/${init.output.result.child}",
|
"url": "https://envk9v55ynw3o.x.pipedream.net//${init.output.result.child}",
|
||||||
"method": "PUT",
|
"method": "PUT",
|
||||||
"headers": {
|
"headers": {
|
||||||
"Authorization": "Bearer bearer_here",
|
"Authorization": "Bearer bearer_here",
|
||||||
|
@ -165,13 +165,13 @@
|
||||||
},
|
},
|
||||||
"body": {
|
"body": {
|
||||||
"type": "Context",
|
"type": "Context",
|
||||||
"id": "${init.output.result.child}",
|
"id": "${extract_vre_id.output.result[0]}",
|
||||||
"name": "${init.output.result.child}",
|
"name": "${init.output.result.child}",
|
||||||
"parent": {
|
"parent": {
|
||||||
"type": "IsParentOf",
|
"type": "IsParentOf",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "Context",
|
"type": "Context",
|
||||||
"id": "${init.output.result.parent}"
|
"id": "${extract_infrastructure_id.output.result[0]}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue