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
63ff07a8
Commit
63ff07a8
authored
Dec 20, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add credentials to toscatemplate
parent
f7f33f11
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
14 deletions
+20
-14
ToscaHelper.java
.../main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
+7
-9
DRIPService.java
...er/src/main/java/nl/uva/sne/drip/service/DRIPService.java
+2
-3
ToscaTemplateService.java
...in/java/nl/uva/sne/drip/service/ToscaTemplateService.java
+5
-1
workspace.xml
drip-planner/.idea/workspace.xml
+6
-1
No files found.
drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
View file @
63ff07a8
...
...
@@ -26,7 +26,6 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
nl.uva.sne.drip.model.NodeTemplate
;
import
nl.uva.sne.drip.model.NodeTemplateMap
;
import
nl.uva.sne.drip.model.tosca.Credential
;
...
...
@@ -36,8 +35,6 @@ import org.apache.commons.io.FileUtils;
import
nl.uva.sne.drip.sure.tosca.client.ApiException
;
import
nl.uva.sne.drip.sure.tosca.client.Configuration
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
/**
*
...
...
@@ -228,13 +225,14 @@ public class ToscaHelper {
return
null
;
}
public
ToscaTemplate
setVMTopologyInToscaTemplate
(
ToscaTemplate
toscaTemplate
,
NodeTemplate
vmTopology
)
{
public
ToscaTemplate
setVMTopologyInToscaTemplate
(
ToscaTemplate
toscaTemplate
,
NodeTemplate
Map
vmTopologyMap
)
{
Map
<
String
,
NodeTemplate
>
nodes
=
toscaTemplate
.
getTopologyTemplate
().
getNodeTemplates
();
Set
<
String
>
keys
=
nodes
.
keySet
();
for
(
String
key
:
keys
)
{
NodeTemplate
node
=
nodes
.
get
(
key
);
}
return
null
;
nodes
.
put
(
vmTopologyMap
.
getName
(),
vmTopologyMap
.
getNodeTemplate
());
// Set<String> keys = nodes.keySet();
// for (String key : keys) {
// NodeTemplate node = nodes.get(key);
// }
return
toscaTemplate
;
}
}
drip-manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java
View file @
63ff07a8
...
...
@@ -103,11 +103,10 @@ public class DRIPService {
if
(
credentials
!=
null
&&
credentials
.
size
()
>
0
)
{
Credential
credential
=
getBestCredential
(
vmTopologyMap
.
getNodeTemplate
(),
credentials
);
vmTopologyMap
=
helper
.
setCredentialsInVMTopology
(
vmTopologyMap
,
credential
);
toscaTemplate
=
helper
.
setVMTopologyInToscaTemplate
(
toscaTemplate
,
vmTopologyMap
.
getNodeTemplate
());
return
toscaTemplate
;
toscaTemplate
=
helper
.
setVMTopologyInToscaTemplate
(
toscaTemplate
,
vmTopologyMap
);
}
}
return
null
;
return
toscaTemplate
;
}
}
drip-manager/src/main/java/nl/uva/sne/drip/service/ToscaTemplateService.java
View file @
63ff07a8
...
...
@@ -13,6 +13,7 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
nl.uva.sne.drip.api.NotFoundException
;
import
nl.uva.sne.drip.dao.ToscaTemplateDAO
;
import
nl.uva.sne.drip.model.tosca.ToscaTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -64,8 +65,11 @@ public class ToscaTemplateService {
return
save
(
tt
);
}
public
String
findByID
(
String
id
)
throws
JsonProcessingException
{
public
String
findByID
(
String
id
)
throws
JsonProcessingException
,
NotFoundException
{
ToscaTemplate
tt
=
dao
.
findById
(
id
).
get
();
if
(
tt
==
null
){
throw
new
NotFoundException
(
404
,
"ToscaTemplate with id: "
+
id
+
" not found"
);
}
String
ymlStr
=
objectMapper
.
writeValueAsString
(
tt
);
return
ymlStr
;
}
...
...
drip-planner/.idea/workspace.xml
View file @
63ff07a8
...
...
@@ -2,13 +2,18 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"e478ccae-5352-4e8e-9efb-3f5cda44e877"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-manager/src/main/java/nl/uva/sne/drip/service/ToscaTemplateService.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-manager/src/main/java/nl/uva/sne/drip/service/ToscaTemplateService.java"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
<option
name=
"LAST_RESOLUTION"
value=
"IGNORE"
/>
</component>
<component
name=
"FavoritesManager"
>
<favorites_list
name=
"drip-planner"
/>
</component>
<component
name=
"FileTemplateManagerImpl"
>
<option
name=
"RECENT_TEMPLATES"
>
<list>
...
...
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