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
01605b7e
Commit
01605b7e
authored
Dec 09, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change schema
parent
2cd7a42d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
8 deletions
+45
-8
CloudStormService.java
...n/java/nl/uva/sne/drip/provisioner/CloudStormService.java
+31
-3
Consumer.java
...r/src/main/java/nl/uva/sne/drip/provisioner/Consumer.java
+1
-1
CloudsStormSubTopology.yml
openAPI/schema/CloudsStormSubTopology.yml
+13
-4
No files found.
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/
ProvisionerRPC
Service.java
→
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/
CloudStorm
Service.java
View file @
01605b7e
...
@@ -15,6 +15,9 @@ import java.util.ArrayList;
...
@@ -15,6 +15,9 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
nl.uva.sne.drip.model.CloudsStormSubTopology
;
import
nl.uva.sne.drip.model.CloudsStormTopTopology
;
import
nl.uva.sne.drip.model.CloudsStormVM
;
import
nl.uva.sne.drip.model.ToscaTemplate
;
import
nl.uva.sne.drip.model.ToscaTemplate
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.io.FilenameUtils
;
...
@@ -22,7 +25,7 @@ import org.apache.commons.io.FilenameUtils;
...
@@ -22,7 +25,7 @@ import org.apache.commons.io.FilenameUtils;
*
*
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
class
ProvisionerRPC
Service
{
class
CloudStorm
Service
{
private
List
<
Map
.
Entry
>
vmTopologies
;
private
List
<
Map
.
Entry
>
vmTopologies
;
private
String
tempInputDirPath
;
private
String
tempInputDirPath
;
...
@@ -39,8 +42,14 @@ class ProvisionerRPCService {
...
@@ -39,8 +42,14 @@ class ProvisionerRPCService {
return
toscaTemplate
;
return
toscaTemplate
;
}
}
private
Map
<
String
,
Object
>
buildCloudStormTopTopology
(
ToscaTemplate
toscaTemplate
)
throws
JSchException
,
IOException
{
private
CloudsStormTopTopology
buildCloudStormTopTopology
(
ToscaTemplate
toscaTemplate
)
throws
JSchException
,
IOException
{
Map
<
String
,
Object
>
topTopology
=
new
HashMap
<>();
CloudsStormTopTopology
topTopology
=
new
CloudsStormTopTopology
();
String
publicKeyPath
=
buildSSHKeyPair
();
topTopology
.
setPublicKeyPath
(
publicKeyPath
);
topTopology
.
setUserName
(
getUserName
());
List
<
CloudsStormSubTopology
>
topologies
=
getCloudsStormSubTopologies
(
toscaTemplate
);
topTopology
.
setTopologies
(
topologies
);
return
topTopology
;
return
topTopology
;
}
}
...
@@ -56,4 +65,23 @@ class ProvisionerRPCService {
...
@@ -56,4 +65,23 @@ class ProvisionerRPCService {
return
publicKeyPath
;
return
publicKeyPath
;
}
}
private
String
getUserName
()
{
return
"vm_user"
;
}
private
List
<
CloudsStormSubTopology
>
getCloudsStormSubTopologies
(
ToscaTemplate
toscaTemplate
)
{
List
<
CloudsStormSubTopology
>
cloudsStormSubTopologies
=
new
ArrayList
<>();
CloudsStormSubTopology
cloudsStormSubTopology
=
new
CloudsStormSubTopology
();
List
<
CloudsStormVM
>
vms
=
new
ArrayList
<>();
CloudsStormVM
cloudsStormVM
=
new
CloudsStormVM
();
cloudsStormVM
.
setName
(
"Node1"
);
vms
.
add
(
cloudsStormVM
);
cloudsStormSubTopology
.
setVms
(
vms
);
cloudsStormSubTopology
.
return
cloudsStormSubTopologies
;
}
}
}
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/Consumer.java
View file @
01605b7e
...
@@ -69,7 +69,7 @@ public class Consumer extends DefaultConsumer {
...
@@ -69,7 +69,7 @@ public class Consumer extends DefaultConsumer {
throw
new
FileNotFoundException
(
"Could not create input directory: "
+
tempInputDir
.
getAbsolutePath
());
throw
new
FileNotFoundException
(
"Could not create input directory: "
+
tempInputDir
.
getAbsolutePath
());
}
}
ProvisionerRPCService
service
=
new
ProvisionerRPC
Service
();
CloudStormService
service
=
new
CloudStorm
Service
();
ToscaTemplate
toscaTemplate
=
service
.
execute
(
message
.
getToscaTemplate
());
ToscaTemplate
toscaTemplate
=
service
.
execute
(
message
.
getToscaTemplate
());
Message
responceMessage
=
new
Message
();
Message
responceMessage
=
new
Message
();
...
...
openAPI/schema/CloudsStormSubTopology.yml
View file @
01605b7e
CloudsStormSubTopology
:
CloudsStormSubTopology
:
type
:
"
object"
type
:
"
object"
properties
:
properties
:
VMs
:
topology
:
type
:
array
type
:
"
string"
items
:
cloudProvider
:
$ref
:
'
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudsStormVM.yml#/CloudsStormVM'
type
:
"
string"
domain
:
type
:
"
string"
status
:
type
:
"
string"
#VMs:
#type: array
#items:
#$ref: 'https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudsStormVM.yml#/CloudsStormVM'
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