|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
"description": "All system services retrieved from the IS through IC Proxy are added as Member to a VRE",
|
|
|
|
|
"version" : 1,
|
|
|
|
|
"ownerEmail" : "marco.lettere@nubisware.com",
|
|
|
|
|
"inputParameters" : ["client_id"],
|
|
|
|
|
"inputParameters" : ["client_resource_id"],
|
|
|
|
|
"tasks" : [
|
|
|
|
|
{
|
|
|
|
|
"name": "LAMBDA_TASK",
|
|
|
|
@ -54,7 +54,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name" : "pyrest",
|
|
|
|
|
"taskReferenceName" : "retrieve_system_services",
|
|
|
|
|
"taskReferenceName" : "retrieve_system_service_names",
|
|
|
|
|
"type" : "SIMPLE",
|
|
|
|
|
"inputParameters" : {
|
|
|
|
|
"url" : "{{ ic_proxy }}/icproxy/gcube/service/ServiceEndpoint/SystemService",
|
|
|
|
@ -67,7 +67,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name" : "pyeval",
|
|
|
|
|
"taskReferenceName" : "extract_client_ids",
|
|
|
|
|
"taskReferenceName" : "extract_system_service_ids",
|
|
|
|
|
"type" : "SIMPLE",
|
|
|
|
|
"inputParameters" : {
|
|
|
|
|
"code" : "exec('import xml.etree.ElementTree as ET') or list(map(lambda n: n.text, ET.fromstring(data['xmlstring']).findall('Resource/Profile/Name')))",
|
|
|
|
@ -90,6 +90,45 @@
|
|
|
|
|
"grant_type" : "client_credentials"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name" : "pyrest",
|
|
|
|
|
"taskReferenceName" : "get_vre",
|
|
|
|
|
"type" : "SIMPLE",
|
|
|
|
|
"inputParameters" : {
|
|
|
|
|
"url" : "${init.input.keycloak_admin}/clients/${workflow.input.client_resource_id}",
|
|
|
|
|
"method" : "GET",
|
|
|
|
|
"headers" : {
|
|
|
|
|
"Authorization" : "Bearer ${authorize.output.body.access_token}",
|
|
|
|
|
"Accept" : "application/json"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "LAMBDA_TASK",
|
|
|
|
|
"taskReferenceName": "build_get_system_services_tasks",
|
|
|
|
|
"type": "LAMBDA",
|
|
|
|
|
"inputParameters": {
|
|
|
|
|
"url" : "${init.input.keycloak_admin}/clients/search=true&clientId=",
|
|
|
|
|
"services" : "${retrieve_system_service_names.output.result}",
|
|
|
|
|
"scriptExpression": "inputs={},tasks=[];for(var i=0;i<$.services.length;i++)s=$.services[i],tasks.push({name:'pyrest',type:'SIMPLE',taskReferenceName:'get_system_service'+i,inputs['get_system_service'+i]={url: $.url + s, method : "GET", "headers" : {"Authorization" : "Bearer ${authorize.output.body.access_token}", "Accept" : "application/json"}};return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name" : "fork_dynamic",
|
|
|
|
|
"type" : "FORK_JOIN_DYNAMIC",
|
|
|
|
|
"taskReferenceName" : "parallel_get_system_services_tasks",
|
|
|
|
|
"inputParameters" : {
|
|
|
|
|
"tasks" : "${build_get_system_services_tasks.output.result.tasks}",
|
|
|
|
|
"inputs" : "${build_get_system_services_tasks.output.result.inputs}"
|
|
|
|
|
},
|
|
|
|
|
"dynamicForkTasksParam": "tasks",
|
|
|
|
|
"dynamicForkTasksInputParamName": "inputs"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name" : "join",
|
|
|
|
|
"type" : "JOIN",
|
|
|
|
|
"taskReferenceName" : "join_parallel_build_member_roles_assignment_tasks"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|