94 lines
2.9 KiB
Django/Jinja
94 lines
2.9 KiB
Django/Jinja
{
|
|
"createTime": 1689260185434,
|
|
"updateTime": 1689259167761,
|
|
"name": "create_vre_folder_for_context",
|
|
"description": "Upon creation of a new context, create also a vre folder on the workspace",
|
|
"version": 1,
|
|
"tasks": [
|
|
{
|
|
"name": "LAMBDA_TASK",
|
|
"taskReferenceName": "init",
|
|
"inputParameters": {
|
|
"root_vo": "{{ root_vo }}",
|
|
"base_url": "https://url.gcube.d4science.org/",
|
|
"keycloak": "{{ keycloak }}/{{ keycloak_realm }}",
|
|
"keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}",
|
|
"storagehub" : "{{ storagehub }}/workspace",
|
|
"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 { shubified_context_name : ($.ctx[0] === '%' ? $.ctx.replace('%2F', '') : $.ctx).split('%2F').join('-') }"
|
|
},
|
|
"type": "LAMBDA",
|
|
"decisionCases": {},
|
|
"defaultCase": [],
|
|
"forkTasks": [],
|
|
"startDelay": 0,
|
|
"joinOn": [],
|
|
"optional": false,
|
|
"defaultExclusiveJoinTask": [],
|
|
"asyncComplete": false,
|
|
"loopOver": []
|
|
},
|
|
{
|
|
"name" : "pyrest",
|
|
"taskReferenceName" : "authorize_with_uma_rpt",
|
|
"type" : "SIMPLE",
|
|
"inputParameters" : {
|
|
"url" : "${init.input.keycloak}/protocol/openid-connect/token",
|
|
"method" : "POST",
|
|
"headers" : {
|
|
"Accept" : "application/json"
|
|
},
|
|
"body" : {
|
|
"audience" : "${init.input.root_vo}",
|
|
"grant_type" : "urn:ietf:params:oauth:grant-type:uma-ticket",
|
|
"client_id" : "orchestrator",
|
|
"client_secret" : "{{ keycloak_auth }}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "pyrest",
|
|
"taskReferenceName": "create_vre_folder",
|
|
"inputParameters": {
|
|
"url": "${init.input.storagehub}/groups",
|
|
"method": "POST",
|
|
"headers": {
|
|
"Authorization": "Bearer ${authorize_with_uma_rpt.output.body.access_token}",
|
|
"Accept": "text/plain",
|
|
"Content-Type": "multipart/form-data"
|
|
},
|
|
"body": {
|
|
"accessType": [
|
|
"WRITE_OWNER",
|
|
"application/json"
|
|
],
|
|
"group": "${init.output.result.shubified_context_name}",
|
|
"folderOwner": "leonardo.candela"
|
|
}
|
|
},
|
|
"type": "SIMPLE",
|
|
"decisionCases": {},
|
|
"defaultCase": [],
|
|
"forkTasks": [],
|
|
"startDelay": 0,
|
|
"joinOn": [],
|
|
"optional": false,
|
|
"defaultExclusiveJoinTask": [],
|
|
"asyncComplete": false,
|
|
"loopOver": []
|
|
}
|
|
],
|
|
"inputParameters": [
|
|
"context"
|
|
],
|
|
"outputParameters": {},
|
|
"schemaVersion": 2,
|
|
"restartable": true,
|
|
"workflowStatusListenerEnabled": false,
|
|
"ownerEmail": "example@email.com",
|
|
"timeoutPolicy": "ALERT_ONLY",
|
|
"timeoutSeconds": 0,
|
|
"variables": {},
|
|
"inputTemplate": {}
|
|
}
|