create SHUB account

This commit is contained in:
Marco Lettere 2021-11-22 17:35:29 +01:00
parent 2653e8547e
commit b3ca00aafe
1 changed files with 33 additions and 1 deletions

View File

@ -171,12 +171,44 @@
"inputParameters" : { "inputParameters" : {
"url" : "${init.input.storagehub}/workspace", "url" : "${init.input.storagehub}/workspace",
"method" : "GET", "method" : "GET",
"expect" : [200, 406],
"headers" : { "headers" : {
"Accept" : "application/json", "Accept" : "application/json",
"Authorization" : "Bearer ${authorize_with_uma_rpt.output.body.access_token}" "Authorization" : "Bearer ${authorize_with_uma_rpt.output.body.access_token}"
} }
} }
},
{
"name": "decision",
"taskReferenceName": "check_workspace_existance",
"inputParameters": {
"status": "${check_workspace.output.status}"
},
"type": "DECISION",
"caseExpression": "($.status === 406 ? 'create' : 'exists')",
"decisionCases": {
"create": [
{
"name" : "pyrest",
"taskReferenceName" : "create_jcr_account",
"type" : "SIMPLE",
"inputParameters" : {
"url" : "${init.input.storagehub}/workspace/users",
"method" : "POST",
"headers" : {
"Content-Type" : "application/x-www-form-urlencoded",
"Accept" : "application/json",
"Authorization" : "Bearer ${authorize.output.body.access_token}"
},
"body" : {
"user" : "${get_service_account_user.output.body.username}",
"password" : "r3u4h-ewrqwli!_m"
} }
}
}
]
}
},
] ]
} }