{ "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": { "base_url": "https://url.gcube.d4science.org/", "keycloak": "{{ keycloak }}/{{ keycloak_realm }}", "keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}", "storagehub" : "{{ storagehub }}", "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_OWN", "folderOwner": "orchestrator", "group": "${init.output.result.shubified_context_name}" } }, "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": {} }