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
321fbae0
Commit
321fbae0
authored
Jan 12, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set tosca template attributes
parent
2a9b1fb1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
320 additions
and
85 deletions
+320
-85
CloudsStormVM.java
...java/nl/uva/sne/drip/model/cloud/storm/CloudsStormVM.java
+251
-42
CloudsStormVMs.java
...ava/nl/uva/sne/drip/model/cloud/storm/CloudsStormVMs.java
+1
-6
DBInfo.java
...c/main/java/nl/uva/sne/drip/model/cloud/storm/DBInfo.java
+13
-7
DCMetaInfo.java
...in/java/nl/uva/sne/drip/model/cloud/storm/DCMetaInfo.java
+19
-9
CloudStormDAO.java
.../main/java/nl/uva/sne/drip/provisioner/CloudStormDAO.java
+3
-2
CloudStormService.java
...n/java/nl/uva/sne/drip/provisioner/CloudStormService.java
+29
-19
CloudsStormVM.yml
openAPI/schema/CloudStorm/CloudsStormVM.yml
+4
-0
No files found.
drip-commons/src/main/java/nl/uva/sne/drip/model/cloud/storm/CloudsStormVM.java
View file @
321fbae0
...
@@ -3,30 +3,31 @@ package nl.uva.sne.drip.model.cloud.storm;
...
@@ -3,30 +3,31 @@ package nl.uva.sne.drip.model.cloud.storm;
import
java.util.Objects
;
import
java.util.Objects
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
javax.validation.Valid
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
javax.validation.Valid
;
/**
/**
* CloudsStormVM
* CloudsStormVM
*/
*/
@Validated
@Validated
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"20
19-12-30T16:13:55.433
Z"
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"20
20-01-12T18:26:54.530
Z"
)
public
class
CloudsStormVM
{
public
class
CloudsStormVM
{
/**
/**
* @return the
extraInfo
* @return the
selfEthAddresses
*/
*/
public
Map
<
String
,
Object
>
getExtraInfo
()
{
public
String
getSelfEthAddresses
()
{
return
extraInfo
;
return
selfEthAddresses
;
}
}
/**
/**
* @param
extraInfo the extraInfo
to set
* @param
selfEthAddresses the selfEthAddresses
to set
*/
*/
public
void
set
ExtraInfo
(
Map
<
String
,
Object
>
extraInfo
)
{
public
void
set
SelfEthAddresses
(
String
selfEthAddresses
)
{
this
.
extraInfo
=
extraInfo
;
this
.
selfEthAddresses
=
selfEthAddresses
;
}
}
@JsonProperty
(
"name"
)
@JsonProperty
(
"name"
)
...
@@ -36,7 +37,7 @@ public class CloudsStormVM {
...
@@ -36,7 +37,7 @@ public class CloudsStormVM {
private
String
nodeType
=
null
;
private
String
nodeType
=
null
;
@JsonProperty
(
"OStype"
)
@JsonProperty
(
"OStype"
)
private
String
os
T
ype
=
null
;
private
String
os
t
ype
=
null
;
@JsonProperty
(
"script"
)
@JsonProperty
(
"script"
)
private
String
script
=
null
;
private
String
script
=
null
;
...
@@ -47,6 +48,10 @@ public class CloudsStormVM {
...
@@ -47,6 +48,10 @@ public class CloudsStormVM {
@JsonProperty
(
"type"
)
@JsonProperty
(
"type"
)
private
String
type
=
null
;
private
String
type
=
null
;
@JsonProperty
(
"extraInfo"
)
@Valid
private
Map
<
String
,
Object
>
extraInfo
=
null
;
@JsonProperty
(
"OS"
)
@JsonProperty
(
"OS"
)
private
String
OS
=
null
;
private
String
OS
=
null
;
...
@@ -57,14 +62,19 @@ public class CloudsStormVM {
...
@@ -57,14 +62,19 @@ public class CloudsStormVM {
private
String
MEM
=
null
;
private
String
MEM
=
null
;
@JsonProperty
(
"VMType"
)
@JsonProperty
(
"VMType"
)
private
String
VM
Type
=
null
;
private
String
vm
Type
=
null
;
@JsonProperty
(
"Price"
)
@JsonProperty
(
"Price"
)
private
String
P
rice
=
null
;
private
String
p
rice
=
null
;
@JsonProperty
(
"extraInfo"
)
@JsonProperty
(
"DefaultSSHAccount"
)
@Valid
private
String
defaultSSHAccount
=
null
;
private
Map
<
String
,
Object
>
extraInfo
=
null
;
@JsonProperty
(
"availability"
)
private
String
availability
=
null
;
@JsonProperty
(
"selfEthAddresses"
)
private
String
selfEthAddresses
=
null
;
public
CloudsStormVM
name
(
String
name
)
{
public
CloudsStormVM
name
(
String
name
)
{
this
.
name
=
name
;
this
.
name
=
name
;
...
@@ -108,25 +118,25 @@ public class CloudsStormVM {
...
@@ -108,25 +118,25 @@ public class CloudsStormVM {
this
.
nodeType
=
nodeType
;
this
.
nodeType
=
nodeType
;
}
}
public
CloudsStormVM
os
Type
(
String
osT
ype
)
{
public
CloudsStormVM
os
type
(
String
ost
ype
)
{
this
.
os
Type
=
osT
ype
;
this
.
os
type
=
ost
ype
;
return
this
;
return
this
;
}
}
/**
/**
* Get os
T
ype
* Get os
t
ype
*
*
* @return os
T
ype
* @return os
t
ype
*
*
*/
*/
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
public
String
getOs
T
ype
()
{
public
String
getOs
t
ype
()
{
return
os
T
ype
;
return
os
t
ype
;
}
}
public
void
setOs
Type
(
String
osT
ype
)
{
public
void
setOs
type
(
String
ost
ype
)
{
this
.
os
Type
=
osT
ype
;
this
.
os
type
=
ost
ype
;
}
}
public
CloudsStormVM
script
(
String
script
)
{
public
CloudsStormVM
script
(
String
script
)
{
...
@@ -171,6 +181,203 @@ public class CloudsStormVM {
...
@@ -171,6 +181,203 @@ public class CloudsStormVM {
this
.
publicAddress
=
publicAddress
;
this
.
publicAddress
=
publicAddress
;
}
}
public
CloudsStormVM
type
(
String
type
)
{
this
.
type
=
type
;
return
this
;
}
/**
* Get type
*
* @return type
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
CloudsStormVM
extraInfo
(
Map
<
String
,
Object
>
extraInfo
)
{
this
.
extraInfo
=
extraInfo
;
return
this
;
}
public
CloudsStormVM
putExtraInfoItem
(
String
key
,
Object
extraInfoItem
)
{
if
(
this
.
extraInfo
==
null
)
{
this
.
extraInfo
=
new
HashMap
<
String
,
Object
>();
}
this
.
extraInfo
.
put
(
key
,
extraInfoItem
);
return
this
;
}
/**
* Get extraInfo
*
* @return extraInfo
*
*/
@ApiModelProperty
(
value
=
""
)
public
Map
<
String
,
Object
>
getExtraInfo
()
{
return
extraInfo
;
}
public
void
setExtraInfo
(
Map
<
String
,
Object
>
extraInfo
)
{
this
.
extraInfo
=
extraInfo
;
}
public
CloudsStormVM
OS
(
String
OS
)
{
this
.
OS
=
OS
;
return
this
;
}
/**
* Get OS
*
* @return OS
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getOS
()
{
return
OS
;
}
public
void
setOS
(
String
OS
)
{
this
.
OS
=
OS
;
}
public
CloudsStormVM
CPU
(
String
CPU
)
{
this
.
CPU
=
CPU
;
return
this
;
}
/**
* Get CPU
*
* @return CPU
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getCPU
()
{
return
CPU
;
}
public
void
setCPU
(
String
CPU
)
{
this
.
CPU
=
CPU
;
}
public
CloudsStormVM
MEM
(
String
MEM
)
{
this
.
MEM
=
MEM
;
return
this
;
}
/**
* Get MEM
*
* @return MEM
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getMEM
()
{
return
MEM
;
}
public
void
setMEM
(
String
MEM
)
{
this
.
MEM
=
MEM
;
}
public
CloudsStormVM
vmType
(
String
vmType
)
{
this
.
vmType
=
vmType
;
return
this
;
}
/**
* Get vmType
*
* @return vmType
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getVmType
()
{
return
vmType
;
}
public
void
setVmType
(
String
vmType
)
{
this
.
vmType
=
vmType
;
}
public
CloudsStormVM
price
(
String
price
)
{
this
.
price
=
price
;
return
this
;
}
/**
* Get price
*
* @return price
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getPrice
()
{
return
price
;
}
public
void
setPrice
(
String
price
)
{
this
.
price
=
price
;
}
public
CloudsStormVM
defaultSSHAccount
(
String
defaultSSHAccount
)
{
this
.
defaultSSHAccount
=
defaultSSHAccount
;
return
this
;
}
/**
* Get defaultSSHAccount
*
* @return defaultSSHAccount
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getDefaultSSHAccount
()
{
return
defaultSSHAccount
;
}
public
void
setDefaultSSHAccount
(
String
defaultSSHAccount
)
{
this
.
defaultSSHAccount
=
defaultSSHAccount
;
}
public
CloudsStormVM
availability
(
String
availability
)
{
this
.
availability
=
availability
;
return
this
;
}
/**
* Get availability
*
* @return availability
*
*/
@ApiModelProperty
(
value
=
""
)
public
String
getAvailability
()
{
return
availability
;
}
public
void
setAvailability
(
String
availability
)
{
this
.
availability
=
availability
;
}
@Override
@Override
public
boolean
equals
(
java
.
lang
.
Object
o
)
{
public
boolean
equals
(
java
.
lang
.
Object
o
)
{
if
(
this
==
o
)
{
if
(
this
==
o
)
{
...
@@ -182,14 +389,23 @@ public class CloudsStormVM {
...
@@ -182,14 +389,23 @@ public class CloudsStormVM {
CloudsStormVM
cloudsStormVM
=
(
CloudsStormVM
)
o
;
CloudsStormVM
cloudsStormVM
=
(
CloudsStormVM
)
o
;
return
Objects
.
equals
(
this
.
name
,
cloudsStormVM
.
name
)
return
Objects
.
equals
(
this
.
name
,
cloudsStormVM
.
name
)
&&
Objects
.
equals
(
this
.
nodeType
,
cloudsStormVM
.
nodeType
)
&&
Objects
.
equals
(
this
.
nodeType
,
cloudsStormVM
.
nodeType
)
&&
Objects
.
equals
(
this
.
os
Type
,
cloudsStormVM
.
osT
ype
)
&&
Objects
.
equals
(
this
.
os
type
,
cloudsStormVM
.
ost
ype
)
&&
Objects
.
equals
(
this
.
script
,
cloudsStormVM
.
script
)
&&
Objects
.
equals
(
this
.
script
,
cloudsStormVM
.
script
)
&&
Objects
.
equals
(
this
.
publicAddress
,
cloudsStormVM
.
publicAddress
);
&&
Objects
.
equals
(
this
.
publicAddress
,
cloudsStormVM
.
publicAddress
)
&&
Objects
.
equals
(
this
.
type
,
cloudsStormVM
.
type
)
&&
Objects
.
equals
(
this
.
extraInfo
,
cloudsStormVM
.
extraInfo
)
&&
Objects
.
equals
(
this
.
OS
,
cloudsStormVM
.
OS
)
&&
Objects
.
equals
(
this
.
CPU
,
cloudsStormVM
.
CPU
)
&&
Objects
.
equals
(
this
.
MEM
,
cloudsStormVM
.
MEM
)
&&
Objects
.
equals
(
this
.
vmType
,
cloudsStormVM
.
vmType
)
&&
Objects
.
equals
(
this
.
price
,
cloudsStormVM
.
price
)
&&
Objects
.
equals
(
this
.
defaultSSHAccount
,
cloudsStormVM
.
defaultSSHAccount
)
&&
Objects
.
equals
(
this
.
availability
,
cloudsStormVM
.
availability
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
return
Objects
.
hash
(
name
,
nodeType
,
os
Type
,
script
,
publicAddress
);
return
Objects
.
hash
(
name
,
nodeType
,
os
type
,
script
,
publicAddress
,
type
,
extraInfo
,
OS
,
CPU
,
MEM
,
vmType
,
price
,
defaultSSHAccount
,
availability
);
}
}
@Override
@Override
...
@@ -199,9 +415,18 @@ public class CloudsStormVM {
...
@@ -199,9 +415,18 @@ public class CloudsStormVM {
sb
.
append
(
" name: "
).
append
(
toIndentedString
(
name
)).
append
(
"\n"
);
sb
.
append
(
" name: "
).
append
(
toIndentedString
(
name
)).
append
(
"\n"
);
sb
.
append
(
" nodeType: "
).
append
(
toIndentedString
(
nodeType
)).
append
(
"\n"
);
sb
.
append
(
" nodeType: "
).
append
(
toIndentedString
(
nodeType
)).
append
(
"\n"
);
sb
.
append
(
" os
Type: "
).
append
(
toIndentedString
(
osT
ype
)).
append
(
"\n"
);
sb
.
append
(
" os
type: "
).
append
(
toIndentedString
(
ost
ype
)).
append
(
"\n"
);
sb
.
append
(
" script: "
).
append
(
toIndentedString
(
script
)).
append
(
"\n"
);
sb
.
append
(
" script: "
).
append
(
toIndentedString
(
script
)).
append
(
"\n"
);
sb
.
append
(
" publicAddress: "
).
append
(
toIndentedString
(
publicAddress
)).
append
(
"\n"
);
sb
.
append
(
" publicAddress: "
).
append
(
toIndentedString
(
publicAddress
)).
append
(
"\n"
);
sb
.
append
(
" type: "
).
append
(
toIndentedString
(
type
)).
append
(
"\n"
);
sb
.
append
(
" extraInfo: "
).
append
(
toIndentedString
(
extraInfo
)).
append
(
"\n"
);
sb
.
append
(
" OS: "
).
append
(
toIndentedString
(
OS
)).
append
(
"\n"
);
sb
.
append
(
" CPU: "
).
append
(
toIndentedString
(
CPU
)).
append
(
"\n"
);
sb
.
append
(
" MEM: "
).
append
(
toIndentedString
(
MEM
)).
append
(
"\n"
);
sb
.
append
(
" vmType: "
).
append
(
toIndentedString
(
vmType
)).
append
(
"\n"
);
sb
.
append
(
" price: "
).
append
(
toIndentedString
(
price
)).
append
(
"\n"
);
sb
.
append
(
" defaultSSHAccount: "
).
append
(
toIndentedString
(
defaultSSHAccount
)).
append
(
"\n"
);
sb
.
append
(
" availability: "
).
append
(
toIndentedString
(
availability
)).
append
(
"\n"
);
sb
.
append
(
"}"
);
sb
.
append
(
"}"
);
return
sb
.
toString
();
return
sb
.
toString
();
}
}
...
@@ -216,20 +441,4 @@ public class CloudsStormVM {
...
@@ -216,20 +441,4 @@ public class CloudsStormVM {
}
}
return
o
.
toString
().
replace
(
"\n"
,
"\n "
);
return
o
.
toString
().
replace
(
"\n"
,
"\n "
);
}
}
public
String
getCPU
()
{
throw
new
UnsupportedOperationException
(
"Not supported yet."
);
//To change body of generated methods, choose Tools | Templates.
}
public
String
getMEM
()
{
throw
new
UnsupportedOperationException
(
"Not supported yet."
);
//To change body of generated methods, choose Tools | Templates.
}
public
String
getVmType
()
{
throw
new
UnsupportedOperationException
(
"Not supported yet."
);
//To change body of generated methods, choose Tools | Templates.
}
public
String
getOS
()
{
throw
new
UnsupportedOperationException
(
"Not supported yet."
);
//To change body of generated methods, choose Tools | Templates.
}
}
}
drip-commons/src/main/java/nl/uva/sne/drip/model/cloud/storm/CloudsStormVMs.java
View file @
321fbae0
...
@@ -12,14 +12,9 @@ import javax.validation.Valid;
...
@@ -12,14 +12,9 @@ import javax.validation.Valid;
* CloudsStormVMs
* CloudsStormVMs
*/
*/
@Validated
@Validated
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"20
19-12-30T16:13:55.433
Z"
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"20
20-01-12T18:26:54.530
Z"
)
public
class
CloudsStormVMs
{
public
class
CloudsStormVMs
{
@JsonProperty
(
"SEngineClass"
)
private
String
sEngineClass
;
@JsonProperty
(
"VMs"
)
@JsonProperty
(
"VMs"
)
@Valid
@Valid
...
...
drip-commons/src/main/java/nl/uva/sne/drip/model/cloud/storm/DBInfo.java
View file @
321fbae0
...
@@ -2,20 +2,17 @@ package nl.uva.sne.drip.model.cloud.storm;
...
@@ -2,20 +2,17 @@ package nl.uva.sne.drip.model.cloud.storm;
import
java.util.Objects
;
import
java.util.Objects
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonCreator
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
nl.uva.sne.drip.model.cloud.storm.DCMetaInfo
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
javax.validation.constraints.*
;
/**
/**
* DBInfo
* DBInfo
*/
*/
@Validated
@Validated
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"20
19-12-11T15:13:55.016
Z"
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"20
20-01-12T18:26:54.530
Z"
)
public
class
DBInfo
{
public
class
DBInfo
{
...
@@ -23,6 +20,7 @@ public class DBInfo {
...
@@ -23,6 +20,7 @@ public class DBInfo {
private
String
globalEntry
=
null
;
private
String
globalEntry
=
null
;
@JsonProperty
(
"DCMetaInfo"
)
@JsonProperty
(
"DCMetaInfo"
)
@Valid
private
List
<
DCMetaInfo
>
dcMetaInfo
=
null
;
private
List
<
DCMetaInfo
>
dcMetaInfo
=
null
;
public
DBInfo
globalEntry
(
String
globalEntry
)
{
public
DBInfo
globalEntry
(
String
globalEntry
)
{
...
@@ -34,7 +32,7 @@ public class DBInfo {
...
@@ -34,7 +32,7 @@ public class DBInfo {
* Get globalEntry
* Get globalEntry
*
*
* @return globalEntry
* @return globalEntry
*
*
*/
*/
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
...
@@ -51,11 +49,19 @@ public class DBInfo {
...
@@ -51,11 +49,19 @@ public class DBInfo {
return
this
;
return
this
;
}
}
public
DBInfo
addDcMetaInfoItem
(
DCMetaInfo
dcMetaInfoItem
)
{
if
(
this
.
dcMetaInfo
==
null
)
{
this
.
dcMetaInfo
=
new
ArrayList
<
DCMetaInfo
>();
}
this
.
dcMetaInfo
.
add
(
dcMetaInfoItem
);
return
this
;
}
/**
/**
* Get dcMetaInfo
* Get dcMetaInfo
*
*
* @return dcMetaInfo
* @return dcMetaInfo
*
*
*/
*/
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
...
...
drip-commons/src/main/java/nl/uva/sne/drip/model/cloud/storm/DCMetaInfo.java
View file @
321fbae0
...
@@ -3,6 +3,7 @@ package nl.uva.sne.drip.model.cloud.storm;
...
@@ -3,6 +3,7 @@ package nl.uva.sne.drip.model.cloud.storm;
import
java.util.Objects
;
import
java.util.Objects
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
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
;
...
@@ -13,7 +14,7 @@ import javax.validation.Valid;
...
@@ -13,7 +14,7 @@ import javax.validation.Valid;
* DCMetaInfo
* DCMetaInfo
*/
*/
@Validated
@Validated
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"20
19-12-11T15:13:55.016
Z"
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.SpringCodegen"
,
date
=
"20
20-01-12T18:26:54.530
Z"
)
public
class
DCMetaInfo
{
public
class
DCMetaInfo
{
...
@@ -36,6 +37,7 @@ public class DCMetaInfo {
...
@@ -36,6 +37,7 @@ public class DCMetaInfo {
private
String
availability
=
null
;
private
String
availability
=
null
;
@JsonProperty
(
"VMMetaInfo"
)
@JsonProperty
(
"VMMetaInfo"
)
@Valid
private
List
<
CloudsStormVM
>
vmMetaInfo
=
null
;
private
List
<
CloudsStormVM
>
vmMetaInfo
=
null
;
@JsonProperty
(
"extraInfo"
)
@JsonProperty
(
"extraInfo"
)
...
@@ -51,7 +53,7 @@ public class DCMetaInfo {
...
@@ -51,7 +53,7 @@ public class DCMetaInfo {
* Get domain
* Get domain
*
*
* @return domain
* @return domain
*
*
*/
*/
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
...
@@ -72,7 +74,7 @@ public class DCMetaInfo {
...
@@ -72,7 +74,7 @@ public class DCMetaInfo {
* Get endpoint
* Get endpoint
*
*
* @return endpoint
* @return endpoint
*
*
*/
*/
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
...
@@ -93,7 +95,7 @@ public class DCMetaInfo {
...
@@ -93,7 +95,7 @@ public class DCMetaInfo {
* Get country
* Get country
*
*
* @return country
* @return country
*
*
*/
*/
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
...
@@ -114,7 +116,7 @@ public class DCMetaInfo {
...
@@ -114,7 +116,7 @@ public class DCMetaInfo {
* Get longitude
* Get longitude
*
*
* @return longitude
* @return longitude
*
*
*/
*/
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
...
@@ -135,7 +137,7 @@ public class DCMetaInfo {
...
@@ -135,7 +137,7 @@ public class DCMetaInfo {
* Get latitude
* Get latitude
*
*
* @return latitude
* @return latitude
*
*
*/
*/
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
...
@@ -156,7 +158,7 @@ public class DCMetaInfo {
...
@@ -156,7 +158,7 @@ public class DCMetaInfo {
* Get availability
* Get availability
*
*
* @return availability
* @return availability
*
*
*/
*/
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
...
@@ -173,11 +175,19 @@ public class DCMetaInfo {
...
@@ -173,11 +175,19 @@ public class DCMetaInfo {
return
this
;
return
this
;
}
}
public
DCMetaInfo
addVmMetaInfoItem
(
CloudsStormVM
vmMetaInfoItem
)
{
if
(
this
.
vmMetaInfo
==
null
)
{
this
.
vmMetaInfo
=
new
ArrayList
<
CloudsStormVM
>();
}
this
.
vmMetaInfo
.
add
(
vmMetaInfoItem
);
return
this
;
}
/**
/**
* Get vmMetaInfo
* Get vmMetaInfo
*
*
* @return vmMetaInfo
* @return vmMetaInfo
*
*
*/
*/
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
...
@@ -208,7 +218,7 @@ public class DCMetaInfo {
...
@@ -208,7 +218,7 @@ public class DCMetaInfo {
* Get extraInfo
* Get extraInfo
*
*
* @return extraInfo
* @return extraInfo
*
*
*/
*/
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormDAO.java
View file @
321fbae0
...
@@ -18,6 +18,7 @@ import nl.uva.sne.drip.model.cloud.storm.CloudDB;
...
@@ -18,6 +18,7 @@ import nl.uva.sne.drip.model.cloud.storm.CloudDB;
import
nl.uva.sne.drip.model.cloud.storm.CloudsStormVM
;
import
nl.uva.sne.drip.model.cloud.storm.CloudsStormVM
;
import
nl.uva.sne.drip.model.cloud.storm.DB
;
import
nl.uva.sne.drip.model.cloud.storm.DB
;
import
nl.uva.sne.drip.model.cloud.storm.DBInfo
;
import
nl.uva.sne.drip.model.cloud.storm.DBInfo
;
import
nl.uva.sne.drip.model.cloud.storm.DCMetaInfo
;
/**
/**
*
*
...
@@ -51,8 +52,8 @@ class CloudStormDAO {
...
@@ -51,8 +52,8 @@ class CloudStormDAO {
List
<
CloudsStormVM
>
vMMetaInfos
=
new
ArrayList
<>();
List
<
CloudsStormVM
>
vMMetaInfos
=
new
ArrayList
<>();
DBInfo
dbInfo
=
objectMapper
.
readValue
(
new
File
(
cloudStormDBPath
+
File
.
separator
+
targetCloudDB
.
getDbInfoFile
()),
DBInfo
.
class
);
DBInfo
dbInfo
=
objectMapper
.
readValue
(
new
File
(
cloudStormDBPath
+
File
.
separator
+
targetCloudDB
.
getDbInfoFile
()),
DBInfo
.
class
);
List
<
CloudsStormVM
>
metaInfos
=
dbInfo
.
getDcMetaInfo
();
List
<
DCMetaInfo
>
metaInfos
=
dbInfo
.
getDcMetaInfo
();
for
(
CloudsStormVM
metaInfo
:
metaInfos
)
{
for
(
DCMetaInfo
metaInfo
:
metaInfos
)
{
vMMetaInfos
.
addAll
(
metaInfo
.
getVmMetaInfo
());
vMMetaInfos
.
addAll
(
metaInfo
.
getVmMetaInfo
());
}
}
return
vMMetaInfos
;
return
vMMetaInfos
;
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
321fbae0
...
@@ -23,7 +23,6 @@ import java.util.List;
...
@@ -23,7 +23,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.Properties
;
import
java.util.Properties
;
import
java.util.Set
;
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.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
...
@@ -176,7 +175,8 @@ class CloudStormService {
...
@@ -176,7 +175,8 @@ class CloudStormService {
cloudsStormVM
.
setNodeType
(
vmType
);
cloudsStormVM
.
setNodeType
(
vmType
);
cloudsStormVM
.
setName
(
"vm"
+
j
);
cloudsStormVM
.
setName
(
"vm"
+
j
);
String
os
=
helper
.
getVMNOS
(
vmMap
);
String
os
=
helper
.
getVMNOS
(
vmMap
);
cloudsStormVM
.
setOsType
(
os
);
cloudsStormVM
.
setOS
(
os
);
cloudsStormVM
.
setOstype
(
os
);
vms
.
add
(
cloudsStormVM
);
vms
.
add
(
cloudsStormVM
);
j
++;
j
++;
}
}
...
@@ -200,8 +200,8 @@ class CloudStormService {
...
@@ -200,8 +200,8 @@ class CloudStormService {
for
(
CloudsStormVM
vmInfo
:
vmInfos
)
{
for
(
CloudsStormVM
vmInfo
:
vmInfos
)
{
Logger
.
getLogger
(
CloudStormService
.
class
.
getName
()).
log
(
Level
.
FINE
,
"vmInfo: {0}"
,
vmInfo
);
Logger
.
getLogger
(
CloudStormService
.
class
.
getName
()).
log
(
Level
.
FINE
,
"vmInfo: {0}"
,
vmInfo
);
Logger
.
getLogger
(
CloudStormService
.
class
.
getName
()).
log
(
Level
.
FINE
,
"numOfCores:{0} memSize: {1} os: {2}"
,
new
Object
[]{
numOfCores
,
memSize
,
os
});
Logger
.
getLogger
(
CloudStormService
.
class
.
getName
()).
log
(
Level
.
FINE
,
"numOfCores:{0} memSize: {1} os: {2}"
,
new
Object
[]{
numOfCores
,
memSize
,
os
});
if
(
Objects
.
equals
(
numOfCores
,
Double
.
valueOf
(
vmInfo
.
getCPU
()))
&&
if
(
Objects
.
equals
(
numOfCores
,
Double
.
valueOf
(
vmInfo
.
getCPU
()))
Objects
.
equals
(
memSize
,
Double
.
valueOf
(
vmInfo
.
getMEM
()))
&&
os
.
toLowerCase
().
equals
(
vmInfo
.
getOS
().
toLowerCase
()))
{
&&
Objects
.
equals
(
memSize
,
Double
.
valueOf
(
vmInfo
.
getMEM
()))
&&
os
.
toLowerCase
().
equals
(
vmInfo
.
getOS
().
toLowerCase
()))
{
return
vmInfo
.
getVmType
();
return
vmInfo
.
getVmType
();
}
}
}
}
...
@@ -303,20 +303,6 @@ class CloudStormService {
...
@@ -303,20 +303,6 @@ class CloudStormService {
}
}
att
.
put
(
"status"
,
subTopology
.
getStatus
().
toString
());
att
.
put
(
"status"
,
subTopology
.
getStatus
().
toString
());
CloudsStormVMs
cloudsStormVMs
=
objectMapper
.
readValue
(
new
File
(
tempInputDirPath
+
TOPOLOGY_RELATIVE_PATH
+
File
.
separator
+
subTopology
.
getTopology
()),
CloudsStormVMs
.
class
);
List
<
CloudsStormVM
>
vms
=
cloudsStormVMs
.
getVms
();
List
<
NodeTemplateMap
>
vmTemplatesMap
=
helper
.
getTemplateVMsForVMTopology
(
nodeTemplateMap
);
int
j
=
0
;
for
(
CloudsStormVM
vm
:
vms
)
{
NodeTemplateMap
vmTemplateMap
=
vmTemplatesMap
.
get
(
j
);
Map
<
String
,
Object
>
vmAttributes
=
vmTemplateMap
.
getNodeTemplate
().
getAttributes
();
if
(
vmAttributes
==
null
){
vmAttributes
=
new
HashMap
<>();
}
vmAttributes
.
put
(
"private_ip"
,
vm
.
get
);
}
String
rootKeyPairFolder
=
tempInputDirPath
+
TOPOLOGY_RELATIVE_PATH
String
rootKeyPairFolder
=
tempInputDirPath
+
TOPOLOGY_RELATIVE_PATH
+
TOP_TOPOLOGY_FILE_NAME
+
File
.
separator
+
subTopology
.
getSshKeyPairId
();
+
TOP_TOPOLOGY_FILE_NAME
+
File
.
separator
+
subTopology
.
getSshKeyPairId
();
Credential
rootKeyPairCredential
=
new
Credential
();
Credential
rootKeyPairCredential
=
new
Credential
();
...
@@ -329,12 +315,36 @@ class CloudStormService {
...
@@ -329,12 +315,36 @@ class CloudStormService {
String
userKyePairFolder
=
tempInputDirPath
+
TOPOLOGY_RELATIVE_PATH
String
userKyePairFolder
=
tempInputDirPath
+
TOPOLOGY_RELATIVE_PATH
+
TOP_TOPOLOGY_FILE_NAME
;
+
TOP_TOPOLOGY_FILE_NAME
;
Credential
userKeyPairCredential
=
new
Credential
();
Credential
userKeyPairCredential
=
new
Credential
();
root
KeyPairCredential
.
setProtocol
(
"ssh"
);
user
KeyPairCredential
.
setProtocol
(
"ssh"
);
keys
=
new
HashMap
<>();
keys
=
new
HashMap
<>();
keys
.
put
(
"private_key"
,
Converter
.
encodeFileToBase64Binary
(
userKyePairFolder
+
File
.
separator
+
"id_rsa"
));
keys
.
put
(
"private_key"
,
Converter
.
encodeFileToBase64Binary
(
userKyePairFolder
+
File
.
separator
+
"id_rsa"
));
keys
.
put
(
"public_key"
,
Converter
.
encodeFileToBase64Binary
(
userKyePairFolder
+
File
.
separator
+
"id_rsa.pub"
));
keys
.
put
(
"public_key"
,
Converter
.
encodeFileToBase64Binary
(
userKyePairFolder
+
File
.
separator
+
"id_rsa.pub"
));
userKeyPairCredential
.
setKeys
(
keys
);
userKeyPairCredential
.
setKeys
(
keys
);
CloudsStormVMs
cloudsStormVMs
=
objectMapper
.
readValue
(
new
File
(
tempInputDirPath
+
TOPOLOGY_RELATIVE_PATH
+
File
.
separator
+
subTopology
.
getTopology
()),
CloudsStormVMs
.
class
);
List
<
CloudsStormVM
>
vms
=
cloudsStormVMs
.
getVms
();
List
<
NodeTemplateMap
>
vmTemplatesMap
=
helper
.
getTemplateVMsForVMTopology
(
nodeTemplateMap
);
int
j
=
0
;
for
(
CloudsStormVM
vm
:
vms
)
{
NodeTemplateMap
vmTemplateMap
=
vmTemplatesMap
.
get
(
j
);
Map
<
String
,
Object
>
vmAttributes
=
vmTemplateMap
.
getNodeTemplate
().
getAttributes
();
if
(
vmAttributes
==
null
)
{
vmAttributes
=
new
HashMap
<>();
}
vmAttributes
.
put
(
"private_ip"
,
vm
.
getSelfEthAddresses
());
vmAttributes
.
put
(
"public_ip"
,
vm
.
getPublicAddress
());
if
(
j
>
0
)
{
vmAttributes
.
put
(
"role"
,
"master"
);
}
else
{
vmAttributes
.
put
(
"role"
,
"worker"
);
}
vmAttributes
.
put
(
"node_type"
,
vm
.
getNodeType
());
vmAttributes
.
put
(
"host_name"
,
vm
.
getName
());
vmAttributes
.
put
(
"root_key_pair"
,
rootKeyPairCredential
);
vmAttributes
.
put
(
"user_key_pair"
,
userKeyPairCredential
);
}
}
}
return
null
;
return
null
;
}
}
...
...
openAPI/schema/CloudStorm/CloudsStormVM.yml
View file @
321fbae0
...
@@ -31,5 +31,9 @@
...
@@ -31,5 +31,9 @@
type
:
"
string"
type
:
"
string"
availability
:
availability
:
type
:
"
string"
type
:
"
string"
selfEthAddresses
:
type
:
"
string"
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