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
ddb85e7c
Commit
ddb85e7c
authored
Dec 12, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check if we plan or provision
parent
ec6a10f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
21 deletions
+36
-21
application_example_updated.yaml
TOSCA/application_example_updated.yaml
+1
-1
DRIPService.java
...er/src/main/java/nl/uva/sne/drip/service/DRIPService.java
+20
-11
workspace.xml
drip-planner/.idea/workspace.xml
+15
-9
No files found.
TOSCA/application_example_updated.yaml
View file @
ddb85e7c
...
...
@@ -2,7 +2,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
imports
:
-
nodes
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml
-
data
:
-
data
:
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml
-
capabilities
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml
-
policies
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml
-
interfaces
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/interfaces.yml
...
...
drip-manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java
View file @
ddb85e7c
...
...
@@ -48,17 +48,8 @@ public class DRIPService {
caller
.
init
();
String
ymlToscaTemplate
=
toscaTemplateService
.
findByID
(
id
);
ToscaTemplate
toscaTemplate
=
toscaTemplateService
.
getYaml2ToscaTemplate
(
ymlToscaTemplate
);
helper
.
uploadToscaTemplate
(
toscaTemplate
);
List
<
NodeTemplate
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
List
<
Credential
>
credentials
=
null
;
for
(
NodeTemplate
vmTopology
:
vmTopologies
)
{
String
provider
=
helper
.
getTopologyProvider
(
vmTopology
);
credentials
=
credentialService
.
findByProvider
(
provider
.
toLowerCase
());
if
(
credentials
!=
null
&&
credentials
.
size
()
>
0
)
{
Credential
credential
=
getBestCredential
(
vmTopology
,
credentials
);
helper
.
setCredentialsInVMTopology
(
vmTopology
,
credential
);
break
;
}
if
(
requestQeueName
.
equals
(
"provisioner"
))
{
toscaTemplate
=
addCredentials
(
toscaTemplate
);
}
Message
message
=
new
Message
();
...
...
@@ -69,6 +60,7 @@ public class DRIPService {
caller
.
setRequestQeueName
(
requestQeueName
);
Message
plannerResponse
=
caller
.
call
(
message
);
ToscaTemplate
plannedToscaTemplate
=
plannerResponse
.
getToscaTemplate
();
return
toscaTemplateService
.
save
(
plannedToscaTemplate
);
}
catch
(
IOException
|
TimeoutException
|
InterruptedException
ex
)
{
Logger
.
getLogger
(
DRIPService
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
...
...
@@ -100,4 +92,21 @@ public class DRIPService {
return
credentials
.
get
(
0
);
}
private
ToscaTemplate
addCredentials
(
ToscaTemplate
toscaTemplate
)
throws
IOException
,
JsonProcessingException
,
ApiException
,
Exception
{
helper
.
uploadToscaTemplate
(
toscaTemplate
);
List
<
NodeTemplate
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
List
<
Credential
>
credentials
=
null
;
for
(
NodeTemplate
vmTopology
:
vmTopologies
)
{
String
provider
=
helper
.
getTopologyProvider
(
vmTopology
);
credentials
=
credentialService
.
findByProvider
(
provider
.
toLowerCase
());
if
(
credentials
!=
null
&&
credentials
.
size
()
>
0
)
{
Credential
credential
=
getBestCredential
(
vmTopology
,
credentials
);
helper
.
setCredentialsInVMTopology
(
vmTopology
,
credential
);
return
toscaTemplate
;
}
}
return
toscaTemplate
;
}
}
drip-planner/.idea/workspace.xml
View file @
ddb85e7c
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"e478ccae-5352-4e8e-9efb-3f5cda44e877"
name=
"Default Changelist"
comment=
""
/>
<list
default=
"true"
id=
"e478ccae-5352-4e8e-9efb-3f5cda44e877"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/../TOSCA/application_example_updated.yaml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../TOSCA/application_example_updated.yaml"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
...
...
@@ -243,21 +245,25 @@
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
</state>
<state
x=
"1043"
y=
"437"
width=
"530"
height=
"598"
key=
"FileChooserDialogImpl/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575907769017"
/>
<state
width=
"
2465"
height=
"410"
key=
"GridCell.Tab.0.bottom"
timestamp=
"157609201857
1"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<state
width=
"
1825"
height=
"283"
key=
"GridCell.Tab.0.bottom"
timestamp=
"157616500340
1"
>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</state>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.bottom/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165003401"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.bottom/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018571"
/>
<state
width=
"
2465"
height=
"410"
key=
"GridCell.Tab.0.center"
timestamp=
"1576092018571
"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<state
width=
"
1825"
height=
"283"
key=
"GridCell.Tab.0.center"
timestamp=
"1576165003399
"
>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</state>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.center/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165003399"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.center/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018571"
/>
<state
width=
"
2465"
height=
"410"
key=
"GridCell.Tab.0.left"
timestamp=
"1576092018570
"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<state
width=
"
1825"
height=
"283"
key=
"GridCell.Tab.0.left"
timestamp=
"1576165003398
"
>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</state>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.left/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165003398"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.left/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018570"
/>
<state
width=
"
2465"
height=
"410"
key=
"GridCell.Tab.0.right"
timestamp=
"1576092018571
"
>
<screen
x=
"67"
y=
"34"
width=
"
2493"
height=
"140
6"
/>
<state
width=
"
1825"
height=
"283"
key=
"GridCell.Tab.0.right"
timestamp=
"1576165003400
"
>
<screen
x=
"67"
y=
"34"
width=
"
1853"
height=
"104
6"
/>
</state>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.right/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165003400"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.right/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018571"
/>
<state
width=
"2465"
height=
"471"
key=
"GridCell.Tab.1.bottom"
timestamp=
"1575891470098"
>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
...
...
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