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
2bcce877
Commit
2bcce877
authored
5 years ago
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove test and adapt for TOSCA
parent
4b613bd4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
38 deletions
+2
-38
P2PConverter.java
...ain/java/nl/uva/sne/drip/drip/converter/P2PConverter.java
+2
-2
testConverter.java
...st/java/nl/uva/sne/drip/drip/converter/testConverter.java
+0
-36
No files found.
drip-planner2provisioner/src/main/java/nl/uva/sne/drip/drip/converter/P2PConverter.java
View file @
2bcce877
...
...
@@ -25,12 +25,12 @@ import org.json.JSONException;
public
class
P2PConverter
{
public
static
SimplePlanContainer
transfer
(
String
toscaPlan
,
public
static
SimplePlanContainer
transfer
(
Map
<
String
,
Object
>
toscaPlanMap
,
String
userName
,
String
domainName
,
String
cloudProvider
)
throws
JsonParseException
,
JsonMappingException
,
IOException
,
JSONException
{
if
(
cloudProvider
!=
null
)
{
cloudProvider
=
cloudProvider
.
toUpperCase
();
}
Map
<
String
,
Object
>
toscaPlanMap
=
Converter
.
ymlString2Map
(
toscaPlan
);
Map
<
String
,
Object
>
topologyTemplate
=
(
Map
<
String
,
Object
>)
((
Map
<
String
,
Object
>)
toscaPlanMap
.
get
(
"topology_template"
)).
get
(
"node_templates"
);
//Get the domain provider and vm list
...
...
This diff is collapsed.
Click to expand it.
drip-planner2provisioner/src/test/java/nl/uva/sne/drip/drip/converter/testConverter.java
deleted
100644 → 0
View file @
4b613bd4
package
nl
.
uva
.
sne
.
drip
.
drip
.
converter
;
import
com.fasterxml.jackson.core.JsonParseException
;
import
com.fasterxml.jackson.databind.JsonMappingException
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Map
;
import
org.apache.commons.io.FileUtils
;
import
org.json.JSONException
;
public
class
testConverter
{
public
static
void
main
(
String
[]
args
)
throws
JsonParseException
,
JsonMappingException
,
JSONException
{
File
jsonFile
=
new
File
(
"input.json"
);
String
json
=
""
;
try
{
json
=
FileUtils
.
readFileToString
(
jsonFile
,
"UTF-8"
);
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
try
{
SimplePlanContainer
spc
=
P2PConverter
.
transfer
(
json
,
"zh9314"
,
"Virginia"
,
"EC2"
);
System
.
out
.
println
(
"--topLevel:\n"
+
spc
.
topLevelContents
);
System
.
out
.
println
(
"--lowLevel:"
);
for
(
Map
.
Entry
<
String
,
String
>
entry
:
spc
.
lowerLevelContents
.
entrySet
())
{
System
.
out
.
println
(
entry
.
getKey
()
+
":\n"
+
entry
.
getValue
());
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
This diff is collapsed.
Click to expand it.
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