Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Melodic
melodic-integration
Commits
d5e92245
Commit
d5e92245
authored
Nov 25, 2021
by
Marta Różańska
Browse files
Merge branch 'branchSynchronization' into 'morphemic-rc2.0'
Branch synchronization See merge request
!30
parents
eb63e397
49787cf6
Pipeline
#17656
failed with stages
in 13 minutes and 40 seconds
Changes
6
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
cloudiator-client/src/main/resources/cloudiator.yaml
deleted
100644 → 0
View file @
eb63e397
This diff is collapsed.
Click to expand it.
interfaces/src/main/resources/services/frontend/frontend.raml
View file @
d5e92245
...
...
@@ -68,8 +68,8 @@ types:
type: object
properties:
nodeGroup:
description: A prefix all
C
loud
iator
managed entities will belong to.
example:
cloudiator
description: A prefix all
c
loud managed entities will belong to.
example:
proactive
type: string
required: false
properties:
...
...
@@ -121,4 +121,4 @@ types:
200:
body:
application/json:
type: DeploymentProcessResponse
\ No newline at end of file
type: DeploymentProcessResponse
mule_esb/mule-integration/src/main/app/implementation.xml
View file @
d5e92245
...
...
@@ -50,7 +50,7 @@ http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mul
<set-property
propertyName=
"Content-Type"
value=
"application/json"
doc:name=
"set Content-Type to application/json"
/>
</when>
<otherwise>
<enricher
source=
"#[payload]"
target=
"#[flowVars.
feedCloudiatorResponse
]"
doc:name=
"Save entryRequest do variable
(feedCloudiatorResponse)
"
>
<enricher
source=
"#[payload]"
target=
"#[flowVars.
ProactiveClient_Call_Msg
]"
doc:name=
"Save entryRequest do variable"
>
<flow-ref
name=
"ProactiveClient_Call_addClouds"
doc:name=
"ProactiveClient_Call_addClouds"
/>
</enricher>
<logger
message=
"ProactiveClient_Call middle processing payload: #[message.payloadAs(java.lang.String)]"
level=
"INFO"
doc:name=
"Logger"
/>
...
...
@@ -59,15 +59,10 @@ http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mul
<flow-ref
name=
"deploymentProcess_POST"
doc:name=
"deploymentProcess_POST"
/>
</enricher>
<logger
message=
"authorizationStatus: #[flowVars.authorizationStatus], autorization token: #[flowVars.melodicAuthorizationToken], refresh token: #[flowVars.refreshToken]"
level=
"INFO"
doc:name=
"Logger"
/>
<logger
message=
"feedCloudiatorResponse: #[flowVars.feedCloudiatorResponse]"
level=
"INFO"
doc:name=
"logger feedCloudiatorResponse"
/>
<logger
message=
"authorizationStatus: #[flowVars.authorizationStatus], autorization token: #[flowVars.melodicAuthorizationToken], refresh token: #[flowVars.refreshToken]"
level=
"TRACE"
doc:name=
"Logger"
/>
<logger
message=
"deploymentProcessResponse : #[flowVars.deploymentProcessResponse]"
level=
"INFO"
doc:name=
"logger deploymentProcessResponse"
/>
<!--
<logger message="ncFetchReponse : #[flowVars.nodeCandidatesResponse]" level="INFO" doc:name="logger nodeCandidatesResponse"/>
<set-payload value="{ "processCreationResult": #[flowVars.deploymentProcessResponse], "createCloudsResponse": #[flowVars.feedCloudiatorResponse], "processAuthorizationStatus": #[flowVars.authorizationStatus], "ncQueryResponse": #[flowVars.nodeCandidatesResponse] }" doc:name="Set Payload"/>
-->
<set-payload
value=
"{ "processCreationResult": #[flowVars.deploymentProcessResponse], "createCloudsResponse": #[flowVars.feedCloudiatorResponse], "processAuthorizationStatus": #[flowVars.authorizationStatus] }"
doc:name=
"Set Payload"
/>
<set-payload
value=
"{ "processCreationResult": #[flowVars.deploymentProcessResponse], "processAuthorizationStatus": #[flowVars.authorizationStatus] }"
doc:name=
"Set Payload"
/>
<set-property
propertyName=
"Content-Type"
value=
"application/json"
doc:name=
"set Content-Type to application/json"
/>
</otherwise>
...
...
@@ -101,7 +96,7 @@ http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mul
<flow
name=
"ProactiveClient_Call_addClouds"
>
<set-variable
variableName=
"ProactiveClient_Call_Msg"
value=
"#[message.payload]"
doc:name=
"Variable"
/>
<json:json-to-object-transformer
returnClass=
"java.util.Map"
doc:name=
"JSON to Object"
/>
<logger
message=
"ProactiveClient_Call_Msg: #[flowVars.ProactiveClient_Call_Msg]"
level=
"
INFO
"
doc:name=
"Logger"
/>
<logger
message=
"ProactiveClient_Call_Msg: #[flowVars.ProactiveClient_Call_Msg]"
level=
"
WARN
"
doc:name=
"Logger"
/>
<set-payload
value=
"#[message.payload.cloudDefinitions]"
doc:name=
"Set Payload"
/>
<logger
message=
"Payload before invoking Proactive Client callAddClouds: #[message.payloadAs(java.lang.String)]"
level=
"INFO"
doc:name=
"Logger"
/>
<invoke
object-ref=
"proactiveClient"
method=
"callAddClouds"
doc:name=
"Invoke callAddClouds"
methodArguments=
"#[payload]"
/>
...
...
mule_esb/mule-integration/src/main/java/cloud/morphemic/mule_integration/proactive/ProactiveClientServiceForIntegrationImpl.java
View file @
d5e92245
...
...
@@ -22,6 +22,12 @@ public class ProactiveClientServiceForIntegrationImpl extends ProactiveClientSer
super
(
restUrl
,
login
,
password
,
encryptorPassword
);
}
/*Fields that are used only for openstack deployment:
-domain
-identityVersion
-scopePrefix
-scopeVariable
*/
@Override
public
void
callAddClouds
(
@Payload
List
<
Object
>
cloudDefinitions
)
{
log
.
info
(
"ProactiveClientServiceForIntegrationImpl->callAddClouds: cloudDefinitions size= {}"
,
cloudDefinitions
.
size
());
...
...
@@ -32,8 +38,8 @@ public class ProactiveClientServiceForIntegrationImpl extends ProactiveClientSer
for
(
Object
cloudDefinition
:
cloudDefinitions
)
{
cloudJSON
=
new
JSONObject
();
log
.
debug
(
"ProactiveClientServiceForIntegrationImpl->callAddClouds: cloudDefinition: class= {}"
,
cloudDefinition
.
getClass
());
log
.
debug
(
"ProactiveClientServiceForIntegrationImpl->callAddClouds: cloudDefinition: toString= {}"
,
cloudDefinition
.
toString
());
log
.
info
(
"ProactiveClientServiceForIntegrationImpl->callAddClouds: cloudDefinition: class= {}"
,
cloudDefinition
.
getClass
());
log
.
info
(
"ProactiveClientServiceForIntegrationImpl->callAddClouds: cloudDefinition: toString= {}"
,
cloudDefinition
.
toString
());
cloudJSON
.
put
(
"cloudID"
,
MoreObjects
.
firstNonNull
(((
LinkedHashMap
)
cloudDefinition
).
get
(
"id"
),
UUID
.
randomUUID
().
toString
()));
cloudJSON
.
put
(
"cloudType"
,
((
LinkedHashMap
)
cloudDefinition
).
get
(
"cloudType"
));
...
...
@@ -45,47 +51,47 @@ public class ProactiveClientServiceForIntegrationImpl extends ProactiveClientSer
throw
new
RuntimeException
(
"Got cloud definition without credentials - user and secret are required to operate with cloud service provider"
);
}
credentialsJSON
=
new
JSONObject
();
credentialsJSON
.
put
(
"domain"
,
credentials
.
get
(
"domain"
));
credentialsJSON
.
put
(
"user"
,
credentials
.
get
(
"user"
));
credentialsJSON
.
put
(
"secret"
,
credentials
.
get
(
"secret"
));
String
securityGroup
=
null
;
String
nodeGroup
=
null
;
String
domain
=
null
;
String
identityVersion
=
null
;
Integer
identityVersion
;
String
scopePrefix
=
null
;
String
scopeValue
=
null
;
String
defaultNetwork
=
null
;
String
regionBlacklist
=
null
;
Integer
identityVersion
;
String
scopePrefix
;
String
scopeValue
;
JSONObject
scopeJSON
=
new
JSONObject
();
LinkedHashMap
cloudConfiguration
=
(
LinkedHashMap
)((
LinkedHashMap
)
cloudDefinition
).
get
(
"cloudConfiguration"
);
if
(
ObjectUtils
.
isNotEmpty
(
cloudConfiguration
))
{
identityVersion
=
(
cloudConfiguration
.
get
(
"identityVersion"
)
!=
null
)
?
Integer
.
parseInt
((
String
)
cloudConfiguration
.
get
(
"identityVersion"
))
:
null
;
scopePrefix
=
(
cloudConfiguration
.
get
(
"scopePrefix"
)
!=
null
)
?
(
String
)
cloudConfiguration
.
get
(
"scopePrefix"
)
:
null
;
scopeValue
=
(
cloudConfiguration
.
get
(
"scopeValue"
)
!=
null
)
?
(
String
)
cloudConfiguration
.
get
(
"scopeValue"
)
:
null
;
cloudJSON
.
put
(
"identityVersion"
,
identityVersion
);
scopeJSON
.
put
(
"prefix"
,
scopePrefix
);
scopeJSON
.
put
(
"value"
,
scopeValue
);
cloudJSON
.
put
(
"scope"
,
scopeJSON
);
LinkedHashMap
properties
=
(
LinkedHashMap
)
cloudConfiguration
.
get
(
"properties"
);
if
(
ObjectUtils
.
isNotEmpty
(
properties
))
{
securityGroup
=
(
String
)
properties
.
get
(
"securityGroup"
);
identityVersion
=
(
String
)
properties
.
get
(
"identityVersion"
);
domain
=
(
String
)
properties
.
get
(
"credentialsDomain"
);
scopePrefix
=
(
String
)
properties
.
get
(
"scopePrefix"
);
scopeValue
=
(
String
)
properties
.
get
(
"scopeValue"
);
defaultNetwork
=
(
String
)
properties
.
get
(
"defaultNetwork"
);
regionBlacklist
=
(
String
)
properties
.
get
(
"regionBlacklist"
);
}
nodeGroup
=
(
String
)
cloudConfiguration
.
get
(
"nodeGroup"
);
}
cloudJSON
.
put
(
"securityGroup"
,
MoreObjects
.
firstNonNull
(
securityGroup
,
JSONObject
.
NULL
));
cloudJSON
.
put
(
"defaultNetwork"
,
MoreObjects
.
firstNonNull
(
defaultNetwork
,
JSONObject
.
NULL
));
cloudJSON
.
put
(
"blacklist"
,
MoreObjects
.
firstNonNull
(
regionBlacklist
,
JSONObject
.
NULL
));
credentialsJSON
.
put
(
"domain"
,
MoreObjects
.
firstNonNull
(
domain
,
JSONObject
.
NULL
));
cloudJSON
.
put
(
"credentials"
,
credentialsJSON
);
cloudJSON
.
put
(
"identityVersion"
,
MoreObjects
.
firstNonNull
(
identityVersion
,
JSONObject
.
NULL
));
scopeJSON
.
put
(
"prefix"
,
MoreObjects
.
firstNonNull
(
scopePrefix
,
JSONObject
.
NULL
));
scopeJSON
.
put
(
"value"
,
MoreObjects
.
firstNonNull
(
scopeValue
,
JSONObject
.
NULL
));
cloudJSON
.
put
(
"scope"
,
scopeJSON
);
cloudJSON
.
put
(
"nodeGroup"
,
MoreObjects
.
firstNonNull
(
nodeGroup
,
JSONObject
.
NULL
));
cloudsJSONArray
.
put
(
cloudJSON
);
log
.
info
(
cloudsJSONArray
.
toString
());
}
log
.
debug
(
"ProactiveClientServiceForIntegrationImpl->callAddClouds: addClouds->cloudsJSONArray= {}"
,
cloudsJSONArray
.
toString
());
log
.
info
(
"ProactiveClientServiceForIntegrationImpl->callAddClouds: addClouds->cloudsJSONArray= {}"
,
cloudsJSONArray
.
toString
());
log
.
info
(
"ProactiveClientServiceForIntegrationImpl->callAddClouds: cloudsJSONArray length= {}"
,
cloudsJSONArray
.
length
());
int
ret
=
addClouds
(
cloudsJSONArray
);
log
.
info
(
"ProactiveClientServiceForIntegrationImpl->callAddClouds: addClouds returned= {}"
,
ret
);
...
...
mule_esb/mule-integration/src/main/resources/eu.melodic.integration.mule.properties
View file @
d5e92245
...
...
@@ -16,16 +16,6 @@ solver_to_deployment.http.port=8096
adapter.http.host
=
mc3
adapter.http.port
=
8097
cloudiator.http.host
=
mc3
cloudiator.http.port
=
9000
cloudiator.http.xkey
=
secure
#http retry configuration when waiting for download Node Candidates
cloudiator.http.nodeCandidates.nb_of_retries
=
2
cloudiator.http.nodeCandidates.timeout
=
10000
cloudiator_proxy.http.host
=
0.0.0.0
cloudiator_proxy.http.port
=
8089
cp_solver.http.host
=
mc3
cp_solver.http.port
=
8093
cp_solver.useUtilityGenerator
=
false
...
...
mule_esb/mule-integration/src/main/resources/mocks/nodeCandidates
View file @
d5e92245
...
...
@@ -12,7 +12,7 @@
"secret": "MySuperSecurePassword"
},
"cloudConfiguration": {
"nodeGroup": "
cloudiator
",
"nodeGroup": "",
"properties": [
{
"key": "sword.regions",
...
...
@@ -94,7 +94,7 @@
"secret": "MySuperSecurePassword"
},
"cloudConfiguration": {
"nodeGroup": "
cloudiator
",
"nodeGroup": "",
"properties": [
{
"key": "sword.regions",
...
...
@@ -176,7 +176,7 @@
"secret": "MySuperSecurePassword"
},
"cloudConfiguration": {
"nodeGroup": "
cloudiator
",
"nodeGroup": "",
"properties": [
{
"key": "sword.regions",
...
...
@@ -258,7 +258,7 @@
"secret": "MySuperSecurePassword"
},
"cloudConfiguration": {
"nodeGroup": "
cloudiator
",
"nodeGroup": "",
"properties": [
{
"key": "sword.regions",
...
...
@@ -340,7 +340,7 @@
"secret": "MySuperSecurePassword"
},
"cloudConfiguration": {
"nodeGroup": "
cloudiator
",
"nodeGroup": "",
"properties": [
{
"key": "sword.regions",
...
...
@@ -422,7 +422,7 @@
"secret": "MySuperSecurePassword"
},
"cloudConfiguration": {
"nodeGroup": "
cloudiator
",
"nodeGroup": "",
"properties": [
{
"key": "sword.regions",
...
...
@@ -491,4 +491,4 @@
}
}
}
]
\ No newline at end of file
]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment