Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
92af4962
Commit
92af4962
authored
Sep 16, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added deploy params to TOSCA
parent
21c571a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
16 deletions
+13
-16
ProvisionService.java
...in/java/nl/uva/sne/drip/api/service/ProvisionService.java
+11
-14
TOSCAUtils.java
...c/main/java/nl/uva/sne/drip/commons/utils/TOSCAUtils.java
+2
-2
No files found.
drip-api/src/main/java/nl/uva/sne/drip/api/service/ProvisionService.java
View file @
92af4962
...
...
@@ -423,10 +423,8 @@ public class ProvisionService {
// Map<String, Object> kvMap = null;
// KeyPair userKey = new KeyPair();
// KeyPair deployerKey = new KeyPair();
// Map<String, Key> privateCloudKeys = new HashMap<>();
// Map<String, Key> publicCloudKeys = new HashMap<>();
PlanResponse
plan
=
addCloudCredentialsOnTOSCAPlan
(
provisionRequest
);
Map
<
String
,
Object
>
toscaPlan
=
plan
.
getKeyValue
();
Map
<
String
,
Object
>
topologyTemplate
=
(
Map
<
String
,
Object
>)
((
Map
<
String
,
Object
>)
toscaPlan
.
get
(
"topology_template"
));
...
...
@@ -469,11 +467,11 @@ public class ProvisionService {
Map
<
String
,
Object
>
properties
=
(
Map
<
String
,
Object
>)
vmList
.
get
(
i
).
get
(
"properties"
);
properties
.
put
(
"user_name"
,
deployUser
);
}
if
(
name
.
contains
(
"_key"
))
{
for
(
String
nodeName
:
nodeNames
)
{
Map
<
String
,
Object
>
keyOutput
=
TOSCAUtils
.
buildTOSCAOutput
(
nodeName
,
p
.
getValue
());
outputs
.
put
(
name
,
keyOutput
);
}
}
if
(
name
.
contains
(
"_key"
)
)
{
for
(
String
nodeName
:
nodeNames
)
{
Map
<
String
,
Object
>
keyOutput
=
TOSCAUtils
.
buildTOSCAOutput
(
nodeName
,
p
.
getValue
()
);
outputs
.
put
(
name
,
keyOutput
);
}
}
// switch (name) {
...
...
@@ -536,12 +534,12 @@ public class ProvisionService {
}
topologyTemplate
.
put
(
"outputs"
,
outputs
);
List
<
String
>
userKeyIds
=
null
;
if
(
provisionRequest
!=
null
)
{
userKeyIds
=
provisionRequest
.
getUserKeyPairIDs
();
}
else
{
// userKeyIds = provisionResponse.getUserKeyPairIDs();
}
//
List<String> userKeyIds = null;
//
if (provisionRequest != null) {
//
userKeyIds = provisionRequest.getUserKeyPairIDs();
//
} else {
//
//
userKeyIds = provisionResponse.getUserKeyPairIDs();
//
}
// if (saveUserKeys) {
// if (userKeyIds != null && !userKeyIds.isEmpty()) {
...
...
@@ -592,7 +590,6 @@ public class ProvisionService {
// existingCloudKeyPairIDs = cloudKeyPairIDs;
// }
// provisionResponse.setCloudKeyPairIDs(existingCloudKeyPairIDs);
// provisionResponse.setDeployParameters(deployParameters);
// provisionResponse.setKvMap(kvMap);
provisionResponse
.
setKvMap
(
toscaPlan
);
...
...
drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/TOSCAUtils.java
View file @
92af4962
...
...
@@ -29,10 +29,10 @@ public class TOSCAUtils {
public
static
List
<
Map
<
String
,
Object
>>
getVMsFromTopology
(
Map
<
String
,
Object
>
toscaPlan
)
{
List
<
String
>
vmNames
=
getVMsNodeNamesFromTopology
(
toscaPlan
);
Map
<
String
,
Object
>
topologyTemplate
=
(
Map
<
String
,
Object
>)
toscaPlan
.
get
(
"topology_template
"
);
Map
<
String
,
Object
>
nodeTemplates
=
(
Map
<
String
,
Object
>)
((
Map
<
String
,
Object
>)
toscaPlan
.
get
(
"topology_template"
)).
get
(
"node_templates
"
);
List
<
Map
<
String
,
Object
>>
vmList
=
new
ArrayList
<>();
for
(
String
vmName
:
vmNames
)
{
Map
<
String
,
Object
>
vm
=
(
Map
<
String
,
Object
>)
topologyTemplate
.
get
(
vmName
);
Map
<
String
,
Object
>
vm
=
(
Map
<
String
,
Object
>)
nodeTemplates
.
get
(
vmName
);
// Map<String, Object> properties = (Map<String, Object>) vm.get("properties");
vmList
.
add
(
vm
);
}
...
...
Write
Preview
Markdown
is supported
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