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
4cf842b3
Commit
4cf842b3
authored
Dec 09, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added subnets
parent
01605b7e
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
504 additions
and
369 deletions
+504
-369
pom.xml
drip-commons/pom.xml
+1
-1
ToscaHelper.java
.../main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
+7
-1
CloudsStormSubTopology.java
...in/java/nl/uva/sne/drip/model/CloudsStormSubTopology.java
+123
-66
CloudsStormTopTopology.java
...in/java/nl/uva/sne/drip/model/CloudsStormTopTopology.java
+111
-110
CloudsStormVM.java
...ns/src/main/java/nl/uva/sne/drip/model/CloudsStormVM.java
+161
-159
application.properties
drip-commons/src/main/resources/application.properties
+8
-0
workspace.xml
drip-planner/.idea/workspace.xml
+13
-6
CloudStormService.java
...n/java/nl/uva/sne/drip/provisioner/CloudStormService.java
+42
-19
Consumer.java
...r/src/main/java/nl/uva/sne/drip/provisioner/Consumer.java
+9
-5
RPCServer.java
.../src/main/java/nl/uva/sne/drip/provisioner/RPCServer.java
+2
-2
CloudsStormSubMembers.yml
openAPI/schema/CloudsStormSubMembers.yml
+8
-0
CloudsStormSubnets.yml
openAPI/schema/CloudsStormSubnets.yml
+14
-0
CloudsStormTopTopology.yml
openAPI/schema/CloudsStormTopTopology.yml
+5
-0
No files found.
drip-commons/pom.xml
View file @
4cf842b3
...
@@ -161,7 +161,7 @@
...
@@ -161,7 +161,7 @@
<goal>generate</goal>
<goal>generate</goal>
</goals>
</goals>
<configuration>
<configuration>
<inputSpec>${basedir}/../openAPI/API/C
ONF-3.0.0-swagger
.yaml</inputSpec>
<inputSpec>${basedir}/../openAPI/API/C
loudStorm-1.0.0-openapi
.yaml</inputSpec>
<generatorName>java</generatorName>
<generatorName>java</generatorName>
<output>${project.build.directory}/generated-sources</output>
<output>${project.build.directory}/generated-sources</output>
<apiPackage>${default.package}.handler</apiPackage>
<apiPackage>${default.package}.handler</apiPackage>
...
...
drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
View file @
4cf842b3
...
@@ -28,6 +28,7 @@ import java.util.Map;
...
@@ -28,6 +28,7 @@ import java.util.Map;
import
nl.uva.sne.drip.commons.sure_tosca.client.ApiException
;
import
nl.uva.sne.drip.commons.sure_tosca.client.ApiException
;
import
nl.uva.sne.drip.commons.sure_tosca.client.Configuration
;
import
nl.uva.sne.drip.commons.sure_tosca.client.Configuration
;
import
nl.uva.sne.drip.commons.sure_tosca.client.DefaultApi
;
import
nl.uva.sne.drip.commons.sure_tosca.client.DefaultApi
;
import
nl.uva.sne.drip.model.NodeTemplate
;
import
nl.uva.sne.drip.model.ToscaTemplate
;
import
nl.uva.sne.drip.model.ToscaTemplate
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
...
@@ -72,11 +73,16 @@ public class ToscaHelper {
...
@@ -72,11 +73,16 @@ public class ToscaHelper {
for
(
String
type
:
toscaInterfaceTypes
)
{
for
(
String
type
:
toscaInterfaceTypes
)
{
String
derivedFrom
=
null
;
String
derivedFrom
=
null
;
List
<
Map
<
String
,
Object
>>
interfaces
=
api
.
getTypes
(
String
.
valueOf
(
id
),
"interface_types"
,
null
,
type
,
null
,
null
,
null
,
null
,
null
,
derivedFrom
);
List
<
Map
<
String
,
Object
>>
interfaces
=
api
.
getTypes
(
String
.
valueOf
(
id
),
"interface_types"
,
null
,
type
,
null
,
null
,
null
,
null
,
null
,
derivedFrom
);
interfaceDefinitions
.
addAll
(
interfaces
);
interfaceDefinitions
.
addAll
(
interfaces
);
}
}
return
interfaceDefinitions
;
return
interfaceDefinitions
;
}
}
public
List
<
NodeTemplate
>
getVMTopologyTemplates
(
ToscaTemplate
toscaTemplate
)
throws
ApiException
{
List
<
NodeTemplate
>
vmTopologyTemplates
=
api
.
getNodeTemplates
(
String
.
valueOf
(
id
),
"tosca.nodes.ARTICONF.VM.topology"
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
);
return
vmTopologyTemplates
;
}
}
}
drip-commons/src/main/java/nl/uva/sne/drip/model/CloudsStormSubTopology.java
View file @
4cf842b3
...
@@ -16,88 +16,145 @@
...
@@ -16,88 +16,145 @@
package
nl
.
uva
.
sne
.
drip
.
model
;
package
nl
.
uva
.
sne
.
drip
.
model
;
import
java.util.Objects
;
import
java.util.Objects
;
import
com.
google.gson.annotations.SerializedName
;
import
com.
fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
*
*
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
@javax
.
annotation
.
Generated
(
value
=
"org.openapitools.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-09T16:00:08.961312+01:00[Europe/Amsterdam]"
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.v3.generators.java.SpringCodegen"
,
date
=
"2019-12-09T15:55:39.959Z[GMT]"
)
public
class
CloudsStormSubTopology
{
public
class
CloudsStormSubTopology
{
@JsonProperty
(
"topology"
)
private
String
topology
=
null
;
public
static
final
String
SERIALIZED_NAME_VMS
=
"VMs"
;
@JsonProperty
(
"cloudProvider"
)
@SerializedName
(
SERIALIZED_NAME_VMS
)
private
String
cloudProvider
=
null
;
private
List
<
CloudsStormVM
>
vms
=
null
;
public
CloudsStormSubTopology
vms
(
List
<
CloudsStormVM
>
vms
)
{
@JsonProperty
(
"domain"
)
private
String
domain
=
null
;
this
.
vms
=
vms
;
@JsonProperty
(
"status"
)
return
this
;
private
String
status
=
null
;
}
public
CloudsStormSubTopology
addVmsItem
(
CloudsStormVM
vmsItem
)
{
public
CloudsStormSubTopology
topology
(
String
topology
)
{
if
(
this
.
vms
==
null
)
{
this
.
topology
=
topology
;
this
.
vms
=
new
ArrayList
<
CloudsStormVM
>();
return
this
;
}
}
this
.
vms
.
add
(
vmsItem
);
return
this
;
}
/**
/**
* Get vms
* Get topology
*
* @return topology
* @return vms
**/
*
@ApiModelProperty
(
value
=
""
)
*/
@javax
.
annotation
.
Nullable
public
String
getTopology
()
{
@ApiModelProperty
(
value
=
""
)
return
topology
;
}
public
List
<
CloudsStormVM
>
getVms
()
{
return
vms
;
}
public
void
setVms
(
List
<
CloudsStormVM
>
vms
)
{
public
void
setTopology
(
String
topology
)
{
this
.
vms
=
vms
;
this
.
topology
=
topology
;
}
}
@Override
public
CloudsStormSubTopology
cloudProvider
(
String
cloudProvider
)
{
public
boolean
equals
(
java
.
lang
.
Object
o
)
{
this
.
cloudProvider
=
cloudProvider
;
if
(
this
==
o
)
{
return
this
;
return
true
;
}
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
CloudsStormSubTopology
cloudsStormSubTopology
=
(
CloudsStormSubTopology
)
o
;
return
Objects
.
equals
(
this
.
vms
,
cloudsStormSubTopology
.
vms
);
}
@Override
/**
public
int
hashCode
()
{
* Get cloudProvider
return
Objects
.
hash
(
vms
);
* @return cloudProvider
}
**/
@ApiModelProperty
(
value
=
""
)
public
String
getCloudProvider
()
{
return
cloudProvider
;
}
@Override
public
void
setCloudProvider
(
String
cloudProvider
)
{
public
String
toString
()
{
this
.
cloudProvider
=
cloudProvider
;
StringBuilder
sb
=
new
StringBuilder
();
}
sb
.
append
(
"class CloudsStormSubTopology {\n"
);
sb
.
append
(
" vms: "
).
append
(
toIndentedString
(
vms
)).
append
(
"\n"
);
public
CloudsStormSubTopology
domain
(
String
domain
)
{
sb
.
append
(
"}"
);
this
.
domain
=
domain
;
return
sb
.
toString
();
return
this
;
}
}
/**
* Get domain
* @return domain
**/
@ApiModelProperty
(
value
=
""
)
public
String
getDomain
()
{
return
domain
;
}
/**
public
void
setDomain
(
String
domain
)
{
* Convert the given object to string with each line indented by 4 spaces
this
.
domain
=
domain
;
* (except the first line).
}
*/
private
String
toIndentedString
(
java
.
lang
.
Object
o
)
{
public
CloudsStormSubTopology
status
(
String
status
)
{
if
(
o
==
null
)
{
this
.
status
=
status
;
return
"null"
;
return
this
;
}
}
return
o
.
toString
().
replace
(
"\n"
,
"\n "
);
/**
* Get status
* @return status
**/
@ApiModelProperty
(
value
=
""
)
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
@Override
public
boolean
equals
(
java
.
lang
.
Object
o
)
{
if
(
this
==
o
)
{
return
true
;
}
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
CloudsStormSubTopology
cloudsStormSubTopology
=
(
CloudsStormSubTopology
)
o
;
return
Objects
.
equals
(
this
.
topology
,
cloudsStormSubTopology
.
topology
)
&&
Objects
.
equals
(
this
.
cloudProvider
,
cloudsStormSubTopology
.
cloudProvider
)
&&
Objects
.
equals
(
this
.
domain
,
cloudsStormSubTopology
.
domain
)
&&
Objects
.
equals
(
this
.
status
,
cloudsStormSubTopology
.
status
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
topology
,
cloudProvider
,
domain
,
status
);
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"class CloudsStormSubTopology {\n"
);
sb
.
append
(
" topology: "
).
append
(
toIndentedString
(
topology
)).
append
(
"\n"
);
sb
.
append
(
" cloudProvider: "
).
append
(
toIndentedString
(
cloudProvider
)).
append
(
"\n"
);
sb
.
append
(
" domain: "
).
append
(
toIndentedString
(
domain
)).
append
(
"\n"
);
sb
.
append
(
" status: "
).
append
(
toIndentedString
(
status
)).
append
(
"\n"
);
sb
.
append
(
"}"
);
return
sb
.
toString
();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private
String
toIndentedString
(
java
.
lang
.
Object
o
)
{
if
(
o
==
null
)
{
return
"null"
;
}
return
o
.
toString
().
replace
(
"\n"
,
"\n "
);
}
}
}
drip-commons/src/main/java/nl/uva/sne/drip/model/CloudsStormTopTopology.java
View file @
4cf842b3
...
@@ -25,137 +25,138 @@ import java.util.List;
...
@@ -25,137 +25,138 @@ import java.util.List;
*
*
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
@javax
.
annotation
.
Generated
(
value
=
"org.openapitools.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-09T16:
00:08.96131
2+01:00[Europe/Amsterdam]"
)
@javax
.
annotation
.
Generated
(
value
=
"org.openapitools.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-09T16:
51:48.83005
2+01:00[Europe/Amsterdam]"
)
public
class
CloudsStormTopTopology
{
public
class
CloudsStormTopTopology
{
public
static
final
String
SERIALIZED_NAME_USER_NAME
=
"userName"
;
@SerializedName
(
SERIALIZED_NAME_USER_NAME
)
private
String
userName
;
public
static
final
String
SERIALIZED_NAME_USER_NAME
=
"userName
"
;
public
static
final
String
SERIALIZED_NAME_PUBLIC_KEY_PATH
=
"publicKeyPath
"
;
@SerializedName
(
SERIALIZED_NAME_USER_NAME
)
@SerializedName
(
SERIALIZED_NAME_PUBLIC_KEY_PATH
)
private
String
userName
;
private
String
publicKeyPath
;
public
static
final
String
SERIALIZED_NAME_PUBLIC_KEY_PATH
=
"publicKeyPath
"
;
public
static
final
String
SERIALIZED_NAME_TOPOLOGIES
=
"topologies
"
;
@SerializedName
(
SERIALIZED_NAME_PUBLIC_KEY_PATH
)
@SerializedName
(
SERIALIZED_NAME_TOPOLOGIES
)
private
String
publicKeyPath
;
private
List
<
CloudsStormSubTopology
>
topologies
=
null
;
public
static
final
String
SERIALIZED_NAME_TOPOLOGIES
=
"topologies"
;
@SerializedName
(
SERIALIZED_NAME_TOPOLOGIES
)
private
List
<
CloudsStormSubTopology
>
topologies
=
null
;
public
CloudsStormTopTopology
userName
(
String
userName
)
{
public
CloudsStormTopTopology
userName
(
String
userName
)
{
this
.
userName
=
userName
;
return
this
;
}
this
.
userName
=
userName
;
/**
return
this
;
* Get userName
}
* @return userName
**/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
/**
public
String
getUserName
()
{
* Get userName
return
userName
;
*
}
* @return userName
*
*/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
CloudsStormTopTopology
publicKeyPath
(
String
publicKeyPath
)
{
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
this
.
publicKeyPath
=
publicKeyPath
;
return
this
;
}
/**
public
CloudsStormTopTopology
publicKeyPath
(
String
publicKeyPath
)
{
* Get publicKeyPath
*
this
.
publicKeyPath
=
publicKeyPath
;
* @return publicKeyPath
return
this
;
*
}
*/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
public
String
getPublicKeyPath
()
{
return
publicKeyPath
;
}
public
void
setPublicKeyPath
(
String
publicKeyPath
)
{
/**
this
.
publicKeyPath
=
publicKeyPath
;
* Get publicKeyPath
}
* @return publicKeyPath
**/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
public
CloudsStormTopTopology
topologies
(
List
<
CloudsStormSubTopology
>
topologies
)
{
public
String
getPublicKeyPath
()
{
return
publicKeyPath
;
}
this
.
topologies
=
topologies
;
return
this
;
}
public
CloudsStormTopTopology
addTopologiesItem
(
CloudsStormSubTopology
topologiesItem
)
{
public
void
setPublicKeyPath
(
String
publicKeyPath
)
{
if
(
this
.
topologies
==
null
)
{
this
.
publicKeyPath
=
publicKeyPath
;
this
.
topologies
=
new
ArrayList
<
CloudsStormSubTopology
>();
}
}
this
.
topologies
.
add
(
topologiesItem
);
return
this
;
}
/**
* Get topologies
*
* @return topologies
*
*/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
public
List
<
CloudsStormSubTopology
>
getTopologies
()
{
return
topologies
;
}
public
void
setTopologies
(
List
<
CloudsStormSubTopology
>
topologies
)
{
public
CloudsStormTopTopology
topologies
(
List
<
CloudsStormSubTopology
>
topologies
)
{
this
.
topologies
=
topologies
;
}
this
.
topologies
=
topologies
;
return
this
;
}
@Override
public
CloudsStormTopTopology
addTopologiesItem
(
CloudsStormSubTopology
topologiesItem
)
{
public
boolean
equals
(
java
.
lang
.
Object
o
)
{
if
(
this
.
topologies
==
null
)
{
if
(
this
==
o
)
{
this
.
topologies
=
new
ArrayList
<
CloudsStormSubTopology
>();
return
true
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
CloudsStormTopTopology
cloudsStormTopTopology
=
(
CloudsStormTopTopology
)
o
;
return
Objects
.
equals
(
this
.
userName
,
cloudsStormTopTopology
.
userName
)
&&
Objects
.
equals
(
this
.
publicKeyPath
,
cloudsStormTopTopology
.
publicKeyPath
)
&&
Objects
.
equals
(
this
.
topologies
,
cloudsStormTopTopology
.
topologies
);
}
}
this
.
topologies
.
add
(
topologiesItem
);
return
this
;
}
@Override
/**
public
int
hashCode
()
{
* Get topologies
return
Objects
.
hash
(
userName
,
publicKeyPath
,
topologies
);
* @return topologies
}
**/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
public
List
<
CloudsStormSubTopology
>
getTopologies
()
{
return
topologies
;
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"class CloudsStormTopTopology {\n"
);
sb
.
append
(
" userName: "
).
append
(
toIndentedString
(
userName
)).
append
(
"\n"
);
sb
.
append
(
" publicKeyPath: "
).
append
(
toIndentedString
(
publicKeyPath
)).
append
(
"\n"
);
sb
.
append
(
" topologies: "
).
append
(
toIndentedString
(
topologies
)).
append
(
"\n"
);
sb
.
append
(
"}"
);
return
sb
.
toString
();
}
/**
public
void
setTopologies
(
List
<
CloudsStormSubTopology
>
topologies
)
{
* Convert the given object to string with each line indented by 4 spaces
this
.
topologies
=
topologies
;
* (except the first line).
}
*/
private
String
toIndentedString
(
java
.
lang
.
Object
o
)
{
if
(
o
==
null
)
{
@Override
return
"null"
;
public
boolean
equals
(
java
.
lang
.
Object
o
)
{
}
if
(
this
==
o
)
{
return
o
.
toString
().
replace
(
"\n"
,
"\n "
);
return
true
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
CloudsStormTopTopology
cloudsStormTopTopology
=
(
CloudsStormTopTopology
)
o
;
return
Objects
.
equals
(
this
.
userName
,
cloudsStormTopTopology
.
userName
)
&&
Objects
.
equals
(
this
.
publicKeyPath
,
cloudsStormTopTopology
.
publicKeyPath
)
&&
Objects
.
equals
(
this
.
topologies
,
cloudsStormTopTopology
.
topologies
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
userName
,
publicKeyPath
,
topologies
);
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"class CloudsStormTopTopology {\n"
);
sb
.
append
(
" userName: "
).
append
(
toIndentedString
(
userName
)).
append
(
"\n"
);
sb
.
append
(
" publicKeyPath: "
).
append
(
toIndentedString
(
publicKeyPath
)).
append
(
"\n"
);
sb
.
append
(
" topologies: "
).
append
(
toIndentedString
(
topologies
)).
append
(
"\n"
);
sb
.
append
(
"}"
);
return
sb
.
toString
();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private
String
toIndentedString
(
java
.
lang
.
Object
o
)
{
if
(
o
==
null
)
{
return
"null"
;
}
}
return
o
.
toString
().
replace
(
"\n"
,
"\n "
);
}
}
}
\ No newline at end of file
drip-commons/src/main/java/nl/uva/sne/drip/model/CloudsStormVM.java
View file @
4cf842b3
...
@@ -23,187 +23,189 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -23,187 +23,189 @@ import io.swagger.annotations.ApiModelProperty;
*
*
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
@javax
.
annotation
.
Generated
(
value
=
"org.openapitools.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-09T16:
00:08.96131
2+01:00[Europe/Amsterdam]"
)
@javax
.
annotation
.
Generated
(
value
=
"org.openapitools.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-09T16:
51:48.83005
2+01:00[Europe/Amsterdam]"
)
public
class
CloudsStormVM
{
public
class
CloudsStormVM
{
public
static
final
String
SERIALIZED_NAME_NAME
=
"name"
;
@SerializedName
(
SERIALIZED_NAME_NAME
)
private
String
name
;
public
static
final
String
SERIALIZED_NAME_NAME
=
"nam
e"
;
public
static
final
String
SERIALIZED_NAME_NODE_TYPE
=
"nodeTyp
e"
;
@SerializedName
(
SERIALIZED_NAME_NAM
E
)
@SerializedName
(
SERIALIZED_NAME_NODE_TYP
E
)
private
String
nam
e
;
private
String
nodeTyp
e
;
public
static
final
String
SERIALIZED_NAME_NODE_TYPE
=
"node
Type"
;
public
static
final
String
SERIALIZED_NAME_OS_TYPE
=
"OS
Type"
;
@SerializedName
(
SERIALIZED_NAME_NODE
_TYPE
)
@SerializedName
(
SERIALIZED_NAME_OS
_TYPE
)
private
String
node
Type
;
private
String
os
Type
;
public
static
final
String
SERIALIZED_NAME_OS_TYPE
=
"OSType
"
;
public
static
final
String
SERIALIZED_NAME_SCRIPT
=
"script
"
;
@SerializedName
(
SERIALIZED_NAME_OS_TYPE
)
@SerializedName
(
SERIALIZED_NAME_SCRIPT
)
private
String
osType
;
private
String
script
;
public
static
final
String
SERIALIZED_NAME_SCRIPT
=
"script
"
;
public
static
final
String
SERIALIZED_NAME_PUBLIC_ADDRESS
=
"publicAddress
"
;
@SerializedName
(
SERIALIZED_NAME_SCRIPT
)
@SerializedName
(
SERIALIZED_NAME_PUBLIC_ADDRESS
)
private
String
script
;
private
String
publicAddress
;
public
static
final
String
SERIALIZED_NAME_PUBLIC_ADDRESS
=
"publicAddress"
;
@SerializedName
(
SERIALIZED_NAME_PUBLIC_ADDRESS
)
private
String
publicAddress
;
public
CloudsStormVM
name
(
String
name
)
{
public
CloudsStormVM
name
(
String
name
)
{
this
.
name
=
name
;
return
this
;
}
this
.
name
=
name
;
/**
return
this
;
* Get name
}
* @return name
**/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
/**
public
String
getName
()
{
* Get name
return
name
;
*
}
* @return name
*
*/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
CloudsStormVM
nodeType
(
String
nodeType
)
{
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
this
.
nodeType
=
nodeType
;
return
this
;
}
/**
public
CloudsStormVM
nodeType
(
String
nodeType
)
{
* Get nodeType
*
this
.
nodeType
=
nodeType
;
* @return nodeType
return
this
;
*
}
*/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
public
String
getNodeType
()
{
return
nodeType
;
}
public
void
setNodeType
(
String
nodeType
)
{
this
.
nodeType
=
nodeType
;
}
public
CloudsStormVM
osType
(
String
osType
)
{
/**
* Get nodeType
* @return nodeType
**/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
this
.
osType
=
osType
;
public
String
getNodeType
()
{
return
this
;
return
nodeType
;
}
}
/**
* Get osType
*
* @return osType
*
*/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
public
String
getOsType
()
{
return
osType
;
}
public
void
setOsType
(
String
os
Type
)
{
public
void
setNodeType
(
String
node
Type
)
{
this
.
osType
=
os
Type
;
this
.
nodeType
=
node
Type
;
}
}
public
CloudsStormVM
script
(
String
script
)
{
this
.
script
=
script
;
public
CloudsStormVM
osType
(
String
osType
)
{
return
this
;
}
this
.
osType
=
osType
;
return
this
;
}
/**
* Get osType
* @return osType
**/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
public
String
getOsType
()
{
return
osType
;
}
public
void
setOsType
(
String
osType
)
{
this
.
osType
=
osType
;
}
public
CloudsStormVM
script
(
String
script
)
{
this
.
script
=
script
;
return
this
;
}
/**
* Get script
* @return script
**/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
public
String
getScript
()
{
return
script
;
}
/**
public
void
setScript
(
String
script
)
{
* Get script
this
.
script
=
script
;
*
}
* @return script
*
*/
public
CloudsStormVM
publicAddress
(
String
publicAddress
)
{
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
this
.
publicAddress
=
publicAddress
;
return
this
;
public
String
getScript
()
{
}
return
script
;
}
/**
* Get publicAddress
* @return publicAddress
**/
@javax
.
annotation
.
Nullable
@ApiModelProperty
(
value
=
""
)
public
String
getPublicAddress
()
{
return
publicAddress
;
}
public
void
setPublicAddress
(
String
publicAddress
)
{
this
.
publicAddress
=
publicAddress
;
}
public
void
setScript
(
String
script
)
{
this
.
script
=
script
;
}
public
CloudsStormVM
publicAddress
(
String
publicAddress
)
{
@Override
public
boolean
equals
(
java
.
lang
.
Object
o
)
{
if
(
this
==
o
)
{
return
true
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
CloudsStormVM
cloudsStormVM
=
(
CloudsStormVM
)
o
;
return
Objects
.
equals
(
this
.
name
,
cloudsStormVM
.
name
)
&&
Objects
.
equals
(
this
.
nodeType
,
cloudsStormVM
.
nodeType
)
&&
Objects
.
equals
(
this
.
osType
,
cloudsStormVM
.
osType
)
&&
Objects
.
equals
(
this
.
script
,
cloudsStormVM
.
script
)
&&
Objects
.
equals
(
this
.
publicAddress
,
cloudsStormVM
.
publicAddress
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
name
,
nodeType
,
osType
,
script
,
publicAddress
);
}
this
.
publicAddress
=
publicAddress
;
return
this
;
@Override
}
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
/**
sb
.
append
(
"class CloudsStormVM {\n"
);
* Get publicAddress
sb
.
append
(
" name: "
).
append
(
toIndentedString
(
name
)).
append
(
"\n"
);
*
sb
.
append
(
" nodeType: "
).
append
(
toIndentedString
(
nodeType
)).
append
(
"\n"
);
* @return publicAddress
sb
.
append
(
" osType: "
).
append
(
toIndentedString
(
osType
)).
append
(
"\n"
);
*
sb
.
append
(
" script: "
).
append
(
toIndentedString
(
script
)).
append
(
"\n"
);
*/
sb
.
append
(
" publicAddress: "
).
append
(
toIndentedString
(
publicAddress
)).
append
(
"\n"
);
@javax
.
annotation
.
Nullable
sb
.
append
(
"}"
);
@ApiModelProperty
(
value
=
""
)
return
sb
.
toString
();
}
public
String
getPublicAddress
()
{
return
publicAddress
;
/**
}
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
public
void
setPublicAddress
(
String
publicAddress
)
{
*/
this
.
publicAddress
=
publicAddress
;
private
String
toIndentedString
(
java
.
lang
.
Object
o
)
{
}
if
(
o
==
null
)
{
return
"null"
;
@Override
}
public
boolean
equals
(
java
.
lang
.
Object
o
)
{
return
o
.
toString
().
replace
(
"\n"
,
"\n "
);
if
(
this
==
o
)
{
}
return
true
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
CloudsStormVM
cloudsStormVM
=
(
CloudsStormVM
)
o
;
return
Objects
.
equals
(
this
.
name
,
cloudsStormVM
.
name
)
&&
Objects
.
equals
(
this
.
nodeType
,
cloudsStormVM
.
nodeType
)
&&
Objects
.
equals
(
this
.
osType
,
cloudsStormVM
.
osType
)
&&
Objects
.
equals
(
this
.
script
,
cloudsStormVM
.
script
)
&&
Objects
.
equals
(
this
.
publicAddress
,
cloudsStormVM
.
publicAddress
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
name
,
nodeType
,
osType
,
script
,
publicAddress
);
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"class CloudsStormVM {\n"
);
sb
.
append
(
" name: "
).
append
(
toIndentedString
(
name
)).
append
(
"\n"
);
sb
.
append
(
" nodeType: "
).
append
(
toIndentedString
(
nodeType
)).
append
(
"\n"
);
sb
.
append
(
" osType: "
).
append
(
toIndentedString
(
osType
)).
append
(
"\n"
);
sb
.
append
(
" script: "
).
append
(
toIndentedString
(
script
)).
append
(
"\n"
);
sb
.
append
(
" publicAddress: "
).
append
(
toIndentedString
(
publicAddress
)).
append
(
"\n"
);
sb
.
append
(
"}"
);
return
sb
.
toString
();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private
String
toIndentedString
(
java
.
lang
.
Object
o
)
{
if
(
o
==
null
)
{
return
"null"
;
}
return
o
.
toString
().
replace
(
"\n"
,
"\n "
);
}
}
}
drip-commons/src/main/resources/application.properties
0 → 100644
View file @
4cf842b3
message.broker.host
=
127.0.0.1
message.broker.username
=
guest
message.broker.password
=
guest
message.broker.queue.provisioner
=
provisioner
message.broker.queue.planner
=
planner
message.broker.queue.deployer
=
deployer
sure-tosca.base.path
=
http://localhost:8081/tosca-sure/1.0.0
drip-planner/.idea/workspace.xml
View file @
4cf842b3
...
@@ -2,8 +2,15 @@
...
@@ -2,8 +2,15 @@
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<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$/../drip-manager/src/main/java/nl/uva/sne/drip/api/ProvisionerApiController.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-manager/src/main/java/nl/uva/sne/drip/api/ProvisionerApiController.java"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/../drip-commons/src/main/resources/application.properties"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/pom.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-commons/pom.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-commons/src/main/java/nl/uva/sne/drip/model/CloudsStormSubTopology.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/model/CloudsStormSubTopology.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/model/CloudsStormTopTopology.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/model/CloudsStormTopTopology.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/model/CloudsStormVM.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/model/CloudsStormVM.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/Consumer.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/Consumer.java"
afterDir=
"false"
/>
</list>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
@@ -29,7 +36,7 @@
...
@@ -29,7 +36,7 @@
</component>
</component>
<component
name=
"PropertiesComponent"
>
<component
name=
"PropertiesComponent"
>
<property
name=
"RunOnceActivity.ShowReadmeOnStart"
value=
"true"
/>
<property
name=
"RunOnceActivity.ShowReadmeOnStart"
value=
"true"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$
/../sure_tosca-flask-server
"
/>
<property
name=
"settings.editor.selected.configurable"
value=
"com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable"
/>
<property
name=
"settings.editor.selected.configurable"
value=
"com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable"
/>
</component>
</component>
<component
name=
"RecentsManager"
>
<component
name=
"RecentsManager"
>
...
@@ -242,10 +249,10 @@
...
@@ -242,10 +249,10 @@
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
</state>
</state>
<state
x=
"925"
y=
"283"
width=
"767"
height=
"906"
key=
"#__main__/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575885420596"
/>
<state
x=
"925"
y=
"283"
width=
"767"
height=
"906"
key=
"#__main__/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575885420596"
/>
<state
x=
"1043"
y=
"437"
width=
"530"
height=
"598"
key=
"FileChooserDialogImpl"
timestamp=
"1575
885341909
"
>
<state
x=
"1043"
y=
"437"
width=
"530"
height=
"598"
key=
"FileChooserDialogImpl"
timestamp=
"1575
907769017
"
>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
</state>
</state>
<state
x=
"1043"
y=
"437"
width=
"530"
height=
"598"
key=
"FileChooserDialogImpl/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575
885341909
"
/>
<state
x=
"1043"
y=
"437"
width=
"530"
height=
"598"
key=
"FileChooserDialogImpl/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575
907769017
"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1575891807013"
>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1575891807013"
>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
</state>
</state>
...
@@ -282,10 +289,10 @@
...
@@ -282,10 +289,10 @@
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
</state>
</state>
<state
x=
"679"
y=
"283"
key=
"SettingsEditor/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575885393075"
/>
<state
x=
"679"
y=
"283"
key=
"SettingsEditor/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575885393075"
/>
<state
x=
"893"
y=
"526"
key=
"com.intellij.ide.util.TipDialog"
timestamp=
"1575
891786241
"
>
<state
x=
"893"
y=
"526"
key=
"com.intellij.ide.util.TipDialog"
timestamp=
"1575
907758846
"
>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
</state>
</state>
<state
x=
"893"
y=
"526"
key=
"com.intellij.ide.util.TipDialog/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575
891786241
"
/>
<state
x=
"893"
y=
"526"
key=
"com.intellij.ide.util.TipDialog/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575
907758846
"
/>
</component>
</component>
<component
name=
"XDebuggerManager"
>
<component
name=
"XDebuggerManager"
>
<breakpoint-manager>
<breakpoint-manager>
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
4cf842b3
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
*/
*/
package
nl
.
uva
.
sne
.
drip
.
provisioner
;
package
nl
.
uva
.
sne
.
drip
.
provisioner
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.jcraft.jsch.JSch
;
import
com.jcraft.jsch.JSch
;
import
com.jcraft.jsch.JSchException
;
import
com.jcraft.jsch.JSchException
;
import
com.jcraft.jsch.KeyPair
;
import
com.jcraft.jsch.KeyPair
;
...
@@ -15,9 +16,12 @@ import java.util.ArrayList;
...
@@ -15,9 +16,12 @@ 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.commons.sure_tosca.client.ApiException
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.model.CloudsStormSubTopology
;
import
nl.uva.sne.drip.model.CloudsStormSubTopology
;
import
nl.uva.sne.drip.model.CloudsStormTopTopology
;
import
nl.uva.sne.drip.model.CloudsStormTopTopology
;
import
nl.uva.sne.drip.model.CloudsStormVM
;
import
nl.uva.sne.drip.model.CloudsStormVM
;
import
nl.uva.sne.drip.model.NodeTemplate
;
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
;
...
@@ -26,33 +30,41 @@ import org.apache.commons.io.FilenameUtils;
...
@@ -26,33 +30,41 @@ import org.apache.commons.io.FilenameUtils;
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
class
CloudStormService
{
class
CloudStormService
{
private
List
<
Map
.
Entry
>
vmTopologies
;
private
List
<
Map
.
Entry
>
vmTopologies
;
private
String
tempInputDirPath
;
private
String
tempInputDirPath
;
private
final
ToscaTemplate
toscaTemplate
;
private
final
ToscaHelper
helper
;
ToscaTemplate
execute
(
ToscaTemplate
toscaTemplate
)
throws
FileNotFoundException
,
JSchException
,
IOException
{
CloudStormService
(
String
sureToscaBasePath
,
ToscaTemplate
toscaTemplate
)
throws
IOException
,
JsonProcessingException
,
ApiException
{
this
.
toscaTemplate
=
toscaTemplate
;
this
.
helper
=
new
ToscaHelper
(
toscaTemplate
,
sureToscaBasePath
);
}
ToscaTemplate
execute
()
throws
FileNotFoundException
,
JSchException
,
IOException
{
tempInputDirPath
=
System
.
getProperty
(
"java.io.tmpdir"
)
+
File
.
separator
+
"Input-"
+
Long
.
toString
(
System
.
nanoTime
())
+
File
.
separator
;
tempInputDirPath
=
System
.
getProperty
(
"java.io.tmpdir"
)
+
File
.
separator
+
"Input-"
+
Long
.
toString
(
System
.
nanoTime
())
+
File
.
separator
;
File
tempInputDir
=
new
File
(
tempInputDirPath
);
File
tempInputDir
=
new
File
(
tempInputDirPath
);
if
(!(
tempInputDir
.
mkdirs
()))
{
if
(!(
tempInputDir
.
mkdirs
()))
{
throw
new
FileNotFoundException
(
"Could not create input directory: "
+
tempInputDir
.
getAbsolutePath
());
throw
new
FileNotFoundException
(
"Could not create input directory: "
+
tempInputDir
.
getAbsolutePath
());
}
}
buildCloudStormTopTopology
(
toscaTemplate
);
buildCloudStormTopTopology
(
toscaTemplate
);
return
toscaTemplate
;
return
toscaTemplate
;
}
}
private
CloudsStormTopTopology
buildCloudStormTopTopology
(
ToscaTemplate
toscaTemplate
)
throws
JSchException
,
IOException
{
private
CloudsStormTopTopology
buildCloudStormTopTopology
(
ToscaTemplate
toscaTemplate
)
throws
JSchException
,
IOException
{
CloudsStormTopTopology
topTopology
=
new
CloudsStormTopTopology
();
CloudsStormTopTopology
topTopology
=
new
CloudsStormTopTopology
();
String
publicKeyPath
=
buildSSHKeyPair
();
String
publicKeyPath
=
buildSSHKeyPair
();
topTopology
.
setPublicKeyPath
(
publicKeyPath
);
topTopology
.
setPublicKeyPath
(
publicKeyPath
);
topTopology
.
setUserName
(
getUserName
());
topTopology
.
setUserName
(
getUserName
());
List
<
CloudsStormSubTopology
>
topologies
=
getCloudsStormSubTopologies
(
toscaTemplate
);
List
<
CloudsStormSubTopology
>
topologies
=
getCloudsStormSubTopologies
(
toscaTemplate
);
topTopology
.
setTopologies
(
topologies
);
topTopology
.
setTopologies
(
topologies
);
return
topTopology
;
return
topTopology
;
}
}
private
String
buildSSHKeyPair
()
throws
JSchException
,
IOException
{
private
String
buildSSHKeyPair
()
throws
JSchException
,
IOException
{
String
userPublicKeyName
=
"id_rsa.pub"
;
String
userPublicKeyName
=
"id_rsa.pub"
;
String
publicKeyPath
=
"name@"
+
userPublicKeyName
;
String
publicKeyPath
=
"name@"
+
userPublicKeyName
;
...
@@ -64,24 +76,35 @@ class CloudStormService {
...
@@ -64,24 +76,35 @@ class CloudStormService {
kpair
.
dispose
();
kpair
.
dispose
();
return
publicKeyPath
;
return
publicKeyPath
;
}
}
private
String
getUserName
()
{
private
String
getUserName
()
{
return
"vm_user"
;
return
"vm_user"
;
}
}
private
List
<
CloudsStormSubTopology
>
getCloudsStormSubTopologies
(
ToscaTemplate
toscaTemplate
)
{
private
List
<
CloudsStormSubTopology
>
getCloudsStormSubTopologies
(
ToscaTemplate
toscaTemplate
)
throws
ApiException
{
List
<
NodeTemplate
>
vmTopologyTemplates
=
helper
.
getVMTopologyTemplates
(
toscaTemplate
);
List
<
CloudsStormSubTopology
>
cloudsStormSubTopologies
=
new
ArrayList
<>();
List
<
CloudsStormSubTopology
>
cloudsStormSubTopologies
=
new
ArrayList
<>();
for
(
NodeTemplate
nodeTemplate:
vmTopologyTemplates
){
CloudsStormSubTopology
cloudsStormSubTopology
=
new
CloudsStormSubTopology
();
CloudsStormSubTopology
cloudsStormSubTopology
=
new
CloudsStormSubTopology
();
List
<
CloudsStormVM
>
vms
=
new
ArrayList
<>();
CloudsStormVM
cloudsStormVM
=
new
CloudsStormVM
();
Map
<
String
,
Object
>
properties
=
nodeTemplate
.
getProperties
();
cloudsStormVM
.
setName
(
"Node1"
);
String
domain
=
(
String
)
properties
.
get
(
"domain"
);
String
provider
=
(
String
)
properties
.
get
(
"provider"
);
cloudsStormSubTopology
.
setCloudProvider
(
domain
);
cloudsStormSubTopology
.
setCloudProvider
(
provider
);
cloudsStormSubTopology
.
setTopology
(
"vm"
);
}
vms
.
add
(
cloudsStormVM
);
cloudsStormSubTopology
.
setVms
(
vms
);
// List<CloudsStormVM> vms = new ArrayList<>();
cloudsStormSubTopology
.
// CloudsStormVM cloudsStormVM = new CloudsStormVM();
// cloudsStormVM.setName("Node1");
//
// vms.add(cloudsStormVM);
return
cloudsStormSubTopologies
;
return
cloudsStormSubTopologies
;
}
}
}
}
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/Consumer.java
View file @
4cf842b3
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
*/
*/
package
nl
.
uva
.
sne
.
drip
.
provisioner
;
package
nl
.
uva
.
sne
.
drip
.
provisioner
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
import
com.jcraft.jsch.JSchException
;
import
com.jcraft.jsch.JSchException
;
...
@@ -28,6 +29,7 @@ import java.io.IOException;
...
@@ -28,6 +29,7 @@ import java.io.IOException;
import
java.util.concurrent.TimeoutException
;
import
java.util.concurrent.TimeoutException
;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
nl.uva.sne.drip.commons.sure_tosca.client.ApiException
;
import
nl.uva.sne.drip.model.Message
;
import
nl.uva.sne.drip.model.Message
;
import
nl.uva.sne.drip.model.ToscaTemplate
;
import
nl.uva.sne.drip.model.ToscaTemplate
;
...
@@ -43,9 +45,11 @@ public class Consumer extends DefaultConsumer {
...
@@ -43,9 +45,11 @@ public class Consumer extends DefaultConsumer {
private
final
Channel
channel
;
private
final
Channel
channel
;
private
final
Logger
logger
;
private
final
Logger
logger
;
private
final
ObjectMapper
objectMapper
;
private
final
ObjectMapper
objectMapper
;
private
final
String
sureToscaBasePath
;
public
Consumer
(
Channel
channel
)
throws
IOException
,
TimeoutException
{
public
Consumer
(
Channel
channel
,
String
sureToscaBasePath
)
throws
IOException
,
TimeoutException
{
super
(
channel
);
super
(
channel
);
this
.
sureToscaBasePath
=
sureToscaBasePath
;
this
.
channel
=
channel
;
this
.
channel
=
channel
;
logger
=
Logger
.
getLogger
(
Consumer
.
class
.
getName
());
logger
=
Logger
.
getLogger
(
Consumer
.
class
.
getName
());
this
.
objectMapper
=
new
ObjectMapper
();
this
.
objectMapper
=
new
ObjectMapper
();
...
@@ -53,7 +57,7 @@ public class Consumer extends DefaultConsumer {
...
@@ -53,7 +57,7 @@ public class Consumer extends DefaultConsumer {
}
}
@Override
@Override
public
void
handleDelivery
(
String
consumerTag
,
Envelope
envelope
,
AMQP
.
BasicProperties
properties
,
byte
[]
body
)
throws
IOException
,
FileNotFoundException
{
public
void
handleDelivery
(
String
consumerTag
,
Envelope
envelope
,
AMQP
.
BasicProperties
properties
,
byte
[]
body
)
throws
IOException
,
FileNotFoundException
,
JsonProcessingException
{
try
{
try
{
//Create the reply properties which tells us where to reply, and which id to use.
//Create the reply properties which tells us where to reply, and which id to use.
//No need to change anything here
//No need to change anything here
...
@@ -69,8 +73,8 @@ public class Consumer extends DefaultConsumer {
...
@@ -69,8 +73,8 @@ 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
());
}
}
CloudStormService
service
=
new
CloudStormService
();
CloudStormService
service
=
new
CloudStormService
(
sureToscaBasePath
,
message
.
getToscaTemplate
()
);
ToscaTemplate
toscaTemplate
=
service
.
execute
(
message
.
getToscaTemplate
()
);
ToscaTemplate
toscaTemplate
=
service
.
execute
();
Message
responceMessage
=
new
Message
();
Message
responceMessage
=
new
Message
();
responceMessage
.
setCreationDate
(
System
.
currentTimeMillis
());
responceMessage
.
setCreationDate
(
System
.
currentTimeMillis
());
...
@@ -83,7 +87,7 @@ public class Consumer extends DefaultConsumer {
...
@@ -83,7 +87,7 @@ public class Consumer extends DefaultConsumer {
//We send the response back. No need to change anything here
//We send the response back. No need to change anything here
channel
.
basicPublish
(
""
,
properties
.
getReplyTo
(),
replyProps
,
response
.
getBytes
(
"UTF-8"
));
channel
.
basicPublish
(
""
,
properties
.
getReplyTo
(),
replyProps
,
response
.
getBytes
(
"UTF-8"
));
channel
.
basicAck
(
envelope
.
getDeliveryTag
(),
false
);
channel
.
basicAck
(
envelope
.
getDeliveryTag
(),
false
);
}
catch
(
JSchException
ex
)
{
}
catch
(
JSchException
|
ApiException
ex
)
{
Logger
.
getLogger
(
Consumer
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
Logger
.
getLogger
(
Consumer
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
}
}
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/RPCServer.java
View file @
4cf842b3
...
@@ -70,11 +70,11 @@ public class RPCServer {
...
@@ -70,11 +70,11 @@ public class RPCServer {
//We define the queue name
//We define the queue name
channel
.
queueDeclare
(
prop
.
getProperty
(
"message.broker.queue.provisioner"
,
"provisioner"
),
false
,
false
,
false
,
null
);
channel
.
queueDeclare
(
prop
.
getProperty
(
"message.broker.queue.provisioner"
,
"provisioner"
),
false
,
false
,
false
,
null
);
DefaultConsumer
c
;
DefaultConsumer
c
;
c
=
new
nl
.
uva
.
sne
.
drip
.
provisioner
.
Consumer
(
channel
);
c
=
new
nl
.
uva
.
sne
.
drip
.
provisioner
.
Consumer
(
channel
,
prop
.
getProperty
(
"sure-tosca.base.path"
)
);
//Start listening for messages
//Start listening for messages
channel
.
basicConsume
(
prop
.
getProperty
(
"message.broker.queue.provisioner"
,
"provisioner"
),
false
,
c
);
channel
.
basicConsume
(
prop
.
getProperty
(
"message.broker.queue.provisioner"
,
"provisioner"
),
false
,
c
);
//Block so we don't close the channel
//Block so we don't close the channel
while
(
true
)
{
while
(
true
)
{
...
...
openAPI/schema/CloudsStormSubMembers.yml
0 → 100644
View file @
4cf842b3
CloudsStormSubMembers
:
type
:
"
object"
properties
:
vmName
:
type
:
"
string"
address
:
type
:
"
string"
openAPI/schema/CloudsStormSubnets.yml
0 → 100644
View file @
4cf842b3
CloudsStormSubnets
:
type
:
"
object"
properties
:
name
:
type
:
"
string"
subnet
:
type
:
"
string"
netmask
:
type
:
"
string"
members
:
type
:
array
items
:
$ref
:
'
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudsStormSubMembers.yml#/CloudsStormSubMembers'
openAPI/schema/CloudsStormTopTopology.yml
View file @
4cf842b3
...
@@ -9,3 +9,8 @@
...
@@ -9,3 +9,8 @@
type
:
array
type
:
array
items
:
items
:
$ref
:
'
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudsStormSubTopology.yml#/CloudsStormSubTopology'
$ref
:
'
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudsStormSubTopology.yml#/CloudsStormSubTopology'
subnets
:
type
:
array
items
:
$ref
:
'
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudsStormSubnets.yml#/CloudsStormSubnets'
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