added two new subworkflows of group_created
This commit is contained in:
parent
ec6969f626
commit
6a6fbca118
|
@ -0,0 +1,97 @@
|
|||
{
|
||||
"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 { decoded_context : $.ctx.replaceAll('%2F', '/') }"
|
||||
},
|
||||
"type": "LAMBDA",
|
||||
"decisionCases": {},
|
||||
"defaultCase": [],
|
||||
"forkTasks": [],
|
||||
"startDelay": 0,
|
||||
"joinOn": [],
|
||||
"optional": false,
|
||||
"defaultExclusiveJoinTask": [],
|
||||
"asyncComplete": false,
|
||||
"loopOver": []
|
||||
},
|
||||
{
|
||||
"name": "pyrest",
|
||||
"taskReferenceName": "authorize",
|
||||
"inputParameters": {
|
||||
"url": "{{ keycloak }}/{{ keycloak_realm }}/protocol/openid-connect/token",
|
||||
"method": "POST",
|
||||
"headers": {
|
||||
"Accept": "application/json"
|
||||
},
|
||||
"body": {
|
||||
"client_id": "orchestrator",
|
||||
"client_secret": "{{ keycloak_auth }}",
|
||||
"grant_type": "client_credentials"
|
||||
}
|
||||
},
|
||||
"type": "SIMPLE",
|
||||
"decisionCases": {},
|
||||
"defaultCase": [],
|
||||
"forkTasks": [],
|
||||
"startDelay": 0,
|
||||
"joinOn": [],
|
||||
"optional": false,
|
||||
"defaultExclusiveJoinTask": [],
|
||||
"asyncComplete": false,
|
||||
"loopOver": []
|
||||
},
|
||||
{
|
||||
"name": "pyrest",
|
||||
"taskReferenceName": "create_vre_folder",
|
||||
"inputParameters": {
|
||||
"url": "https://en5ql62qrka7q.x.pipedream.net/${init.output.result.child}",
|
||||
"method": "POST",
|
||||
"headers": {
|
||||
"Authorization": "Bearer bearer_here",
|
||||
"Accept": "application/json",
|
||||
"Content-Type": "multipart/form-data"
|
||||
},
|
||||
"body": {
|
||||
"accessType": "WRITE_ALL",
|
||||
"folderOwner": "",
|
||||
"group": "${init.output.result.decoded_context}"
|
||||
}
|
||||
},
|
||||
"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": {}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
{
|
||||
"createTime": 1689254203836,
|
||||
"updateTime": 1689259676819,
|
||||
"name": "record_context_to_is",
|
||||
"description": "Upon creation of a new context, record it to the Information System",
|
||||
"version": 1,
|
||||
"tasks": [
|
||||
{
|
||||
"name": "LAMBDA_TASK",
|
||||
"taskReferenceName": "init",
|
||||
"inputParameters": {
|
||||
"base_url": "{{is_url}}/resource-registry/contexts",
|
||||
"root_vo": "{{ root_vo }}",
|
||||
"keycloak": "{{ keycloak }}/{{ keycloak_realm }}",
|
||||
"keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}",
|
||||
"ctx": "${workflow.input.context}",
|
||||
"scriptExpression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))} if(e($.ctx)) throw('Context 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', '/') }"
|
||||
},
|
||||
"type": "LAMBDA",
|
||||
"decisionCases": {},
|
||||
"defaultCase": [],
|
||||
"forkTasks": [],
|
||||
"startDelay": 0,
|
||||
"joinOn": [],
|
||||
"optional": false,
|
||||
"defaultExclusiveJoinTask": [],
|
||||
"asyncComplete": false,
|
||||
"loopOver": []
|
||||
},
|
||||
{
|
||||
"name" : "pyrest",
|
||||
"taskReferenceName" : "authorize",
|
||||
"type" : "SIMPLE",
|
||||
"inputParameters" : {
|
||||
"url" : "{{ keycloak }}/{{ keycloak_realm }}/protocol/openid-connect/token",
|
||||
"method" : "POST",
|
||||
"headers" : {
|
||||
"Accept" : "application/json"
|
||||
},
|
||||
"body" : {
|
||||
"client_id" : "orchestrator",
|
||||
"client_secret" : "{{ keycloak_auth }}",
|
||||
"grant_type" : "client_credentials"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pyrest",
|
||||
"taskReferenceName": "write_to_is",
|
||||
"inputParameters": {
|
||||
"url": "https://en5ql62qrka7q.x.pipedream.net/${init.output.result.child}",
|
||||
"method": "PUT",
|
||||
"headers": {
|
||||
"Authorization": "Bearer bearer_here",
|
||||
"Accept": "application/json",
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"body": {
|
||||
"type": "Context",
|
||||
"id": "${init.output.result.child}",
|
||||
"name": "${init.output.result.child}",
|
||||
"parent": {
|
||||
"type": "IsParentOf",
|
||||
"source": {
|
||||
"type": "Context",
|
||||
"id": "${init.output.result.parent}"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": {}
|
||||
}
|
Loading…
Reference in New Issue