fixed workflow

This commit is contained in:
Marco Lettere 2023-07-14 16:11:13 +02:00
parent 0846edfb75
commit 00782d90e1
1 changed files with 24 additions and 32 deletions

View File

@ -10,11 +10,11 @@
"taskReferenceName": "init", "taskReferenceName": "init",
"inputParameters": { "inputParameters": {
"base_url": "https://url.gcube.d4science.org/", "base_url": "https://url.gcube.d4science.org/",
"keycloak": "{{ keycloak }}/{{ keycloak_realm }}", "keycloak": "{{ keycloak }}/{{ keycloak_realm }}",
"keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}", "keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}",
"storagehub" : "{{ storagehub }}", "storagehub" : "{{ storagehub }}",
"ctx": "${workflow.input.context}", "ctx": "${workflow.input.context}",
"scriptExpression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))} if(e($.ctx)) throw('Context must not be empty'); return { decoded_context : $.ctx.replaceAll('%2F', '/') }" "scriptExpression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))} if(e($.ctx)) throw('Context must not be empty'); return { shubified_context_name : ($.ctx[0] === '%' ? $.ctx.replace('%2F', '') : $.ctx).split('%2F').join('-') }"
}, },
"type": "LAMBDA", "type": "LAMBDA",
"decisionCases": {}, "decisionCases": {},
@ -28,46 +28,38 @@
"loopOver": [] "loopOver": []
}, },
{ {
"name": "pyrest", "name" : "pyrest",
"taskReferenceName": "authorize", "taskReferenceName" : "authorize_with_uma_rpt",
"inputParameters": { "type" : "SIMPLE",
"url": "{{ keycloak }}/{{ keycloak_realm }}/protocol/openid-connect/token", "inputParameters" : {
"method": "POST", "url" : "${init.input.keycloak}/protocol/openid-connect/token",
"headers": { "method" : "POST",
"Accept": "application/json" "headers" : {
}, "Accept" : "application/json"
"body": { },
"client_id": "orchestrator", "body" : {
"client_secret": "{{ keycloak_auth }}", "audience" : "${init.input.root_vo}",
"grant_type": "client_credentials" "grant_type" : "urn:ietf:params:oauth:grant-type:uma-ticket",
"client_id" : "orchestrator",
"client_secret" : "{{ keycloak_auth }}"
}
} }
},
"type": "SIMPLE",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": []
}, },
{ {
"name": "pyrest", "name": "pyrest",
"taskReferenceName": "create_vre_folder", "taskReferenceName": "create_vre_folder",
"inputParameters": { "inputParameters": {
"url": "https://en5ql62qrka7q.x.pipedream.net/${init.output.result.child}", "url": "${init.input.storagehub}/groups",
"method": "POST", "method": "POST",
"headers": { "headers": {
"Authorization": "Bearer bearer_here", "Authorization": "Bearer ${authorize_with_uma_rpt.output.body.access_token}",
"Accept": "application/json", "Accept": "text/plain",
"Content-Type": "multipart/form-data" "Content-Type": "multipart/form-data"
}, },
"body": { "body": {
"accessType": "WRITE_ALL", "accessType": "WRITE_OWN",
"folderOwner": "", "folderOwner": "orchestrator",
"group": "${init.output.result.decoded_context}" "group": "${init.output.result.shubified_context_name}"
} }
}, },
"type": "SIMPLE", "type": "SIMPLE",