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
8da728d5
Commit
8da728d5
authored
Jan 13, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added alias
parent
321fbae0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
59 deletions
+60
-59
CloudsStormVM.java
...java/nl/uva/sne/drip/model/cloud/storm/CloudsStormVM.java
+54
-53
CloudStormService.java
...n/java/nl/uva/sne/drip/provisioner/CloudStormService.java
+5
-5
CloudsStormVM.yml
openAPI/schema/CloudStorm/CloudsStormVM.yml
+1
-1
No files found.
drip-commons/src/main/java/nl/uva/sne/drip/model/cloud/storm/CloudsStormVM.java
View file @
8da728d5
package
nl
.
uva
.
sne
.
drip
.
model
.
cloud
.
storm
;
package
nl
.
uva
.
sne
.
drip
.
model
.
cloud
.
storm
;
import
com.fasterxml.jackson.annotation.JsonAlias
;
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
;
...
@@ -37,6 +38,7 @@ public class CloudsStormVM {
...
@@ -37,6 +38,7 @@ public class CloudsStormVM {
private
String
nodeType
=
null
;
private
String
nodeType
=
null
;
@JsonProperty
(
"OStype"
)
@JsonProperty
(
"OStype"
)
@JsonAlias
({
"os"
,
"OS"
})
private
String
ostype
=
null
;
private
String
ostype
=
null
;
@JsonProperty
(
"script"
)
@JsonProperty
(
"script"
)
...
@@ -44,17 +46,17 @@ public class CloudsStormVM {
...
@@ -44,17 +46,17 @@ public class CloudsStormVM {
@JsonProperty
(
"publicAddress"
)
@JsonProperty
(
"publicAddress"
)
private
String
publicAddress
=
null
;
private
String
publicAddress
=
null
;
//
@JsonProperty
(
"type"
)
//
@JsonProperty("type")
private
String
type
=
null
;
//
private String type = null;
@JsonProperty
(
"extraInfo"
)
@JsonProperty
(
"extraInfo"
)
@Valid
@Valid
private
Map
<
String
,
Object
>
extraInfo
=
null
;
private
Map
<
String
,
Object
>
extraInfo
=
null
;
@JsonProperty
(
"OS"
)
//
@JsonProperty("OS")
private
String
OS
=
null
;
// @JsonAlias({"os", "mybkcat"})
// private String OS = null;
@JsonProperty
(
"CPU"
)
@JsonProperty
(
"CPU"
)
private
String
CPU
=
null
;
private
String
CPU
=
null
;
...
@@ -62,6 +64,7 @@ public class CloudsStormVM {
...
@@ -62,6 +64,7 @@ public class CloudsStormVM {
private
String
MEM
=
null
;
private
String
MEM
=
null
;
@JsonProperty
(
"VMType"
)
@JsonProperty
(
"VMType"
)
@JsonAlias
({
"type"
})
private
String
vmType
=
null
;
private
String
vmType
=
null
;
@JsonProperty
(
"Price"
)
@JsonProperty
(
"Price"
)
...
@@ -181,27 +184,26 @@ public class CloudsStormVM {
...
@@ -181,27 +184,26 @@ public class CloudsStormVM {
this
.
publicAddress
=
publicAddress
;
this
.
publicAddress
=
publicAddress
;
}
}
public
CloudsStormVM
type
(
String
type
)
{
// public CloudsStormVM type(String type) {
this
.
type
=
type
;
// this.type = type;
return
this
;
// return this;
}
// }
//
/**
// /**
* Get type
// * Get type
*
// *
* @return type
// * @return type
*
// *
*/
// */
@ApiModelProperty
(
value
=
""
)
// @ApiModelProperty(value = "")
//
public
String
getType
()
{
// public String getType() {
return
type
;
// return type;
}
// }
//
public
void
setType
(
String
type
)
{
// public void setType(String type) {
this
.
type
=
type
;
// this.type = type;
}
// }
public
CloudsStormVM
extraInfo
(
Map
<
String
,
Object
>
extraInfo
)
{
public
CloudsStormVM
extraInfo
(
Map
<
String
,
Object
>
extraInfo
)
{
this
.
extraInfo
=
extraInfo
;
this
.
extraInfo
=
extraInfo
;
return
this
;
return
this
;
...
@@ -231,27 +233,26 @@ public class CloudsStormVM {
...
@@ -231,27 +233,26 @@ public class CloudsStormVM {
this
.
extraInfo
=
extraInfo
;
this
.
extraInfo
=
extraInfo
;
}
}
public
CloudsStormVM
OS
(
String
OS
)
{
// public CloudsStormVM OS(String OS) {
this
.
OS
=
OS
;
// this.OS = OS;
return
this
;
// return this;
}
// }
//
/**
// /**
* Get OS
// * Get OS
*
// *
* @return OS
// * @return OS
*
// *
*/
// */
@ApiModelProperty
(
value
=
""
)
// @ApiModelProperty(value = "")
//
public
String
getOS
()
{
// public String getOS() {
return
OS
;
// return OS;
}
// }
//
public
void
setOS
(
String
OS
)
{
// public void setOS(String OS) {
this
.
OS
=
OS
;
// this.OS = OS;
}
// }
public
CloudsStormVM
CPU
(
String
CPU
)
{
public
CloudsStormVM
CPU
(
String
CPU
)
{
this
.
CPU
=
CPU
;
this
.
CPU
=
CPU
;
return
this
;
return
this
;
...
@@ -392,9 +393,9 @@ public class CloudsStormVM {
...
@@ -392,9 +393,9 @@ public class CloudsStormVM {
&&
Objects
.
equals
(
this
.
ostype
,
cloudsStormVM
.
ostype
)
&&
Objects
.
equals
(
this
.
ostype
,
cloudsStormVM
.
ostype
)
&&
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.type, cloudsStormVM.type)
&&
Objects
.
equals
(
this
.
extraInfo
,
cloudsStormVM
.
extraInfo
)
&&
Objects
.
equals
(
this
.
extraInfo
,
cloudsStormVM
.
extraInfo
)
&&
Objects
.
equals
(
this
.
OS
,
cloudsStormVM
.
OS
)
//
&& Objects.equals(this.OS, cloudsStormVM.OS)
&&
Objects
.
equals
(
this
.
CPU
,
cloudsStormVM
.
CPU
)
&&
Objects
.
equals
(
this
.
CPU
,
cloudsStormVM
.
CPU
)
&&
Objects
.
equals
(
this
.
MEM
,
cloudsStormVM
.
MEM
)
&&
Objects
.
equals
(
this
.
MEM
,
cloudsStormVM
.
MEM
)
&&
Objects
.
equals
(
this
.
vmType
,
cloudsStormVM
.
vmType
)
&&
Objects
.
equals
(
this
.
vmType
,
cloudsStormVM
.
vmType
)
...
@@ -405,7 +406,7 @@ public class CloudsStormVM {
...
@@ -405,7 +406,7 @@ public class CloudsStormVM {
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
return
Objects
.
hash
(
name
,
nodeType
,
ostype
,
script
,
publicAddress
,
type
,
extraInfo
,
OS
,
CPU
,
MEM
,
vmType
,
price
,
defaultSSHAccount
,
availability
);
return
Objects
.
hash
(
name
,
nodeType
,
ostype
,
script
,
publicAddress
,
extraInfo
,
CPU
,
MEM
,
vmType
,
price
,
defaultSSHAccount
,
availability
);
}
}
@Override
@Override
...
@@ -418,9 +419,9 @@ public class CloudsStormVM {
...
@@ -418,9 +419,9 @@ public class CloudsStormVM {
sb
.
append
(
" ostype: "
).
append
(
toIndentedString
(
ostype
)).
append
(
"\n"
);
sb
.
append
(
" ostype: "
).
append
(
toIndentedString
(
ostype
)).
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(" type: ").append(toIndentedString(type)).append("\n");
sb
.
append
(
" extraInfo: "
).
append
(
toIndentedString
(
extraInfo
)).
append
(
"\n"
);
sb
.
append
(
" extraInfo: "
).
append
(
toIndentedString
(
extraInfo
)).
append
(
"\n"
);
sb
.
append
(
" OS: "
).
append
(
toIndentedString
(
OS
)).
append
(
"\n"
);
//
sb.append(" OS: ").append(toIndentedString(OS)).append("\n");
sb
.
append
(
" CPU: "
).
append
(
toIndentedString
(
CPU
)).
append
(
"\n"
);
sb
.
append
(
" CPU: "
).
append
(
toIndentedString
(
CPU
)).
append
(
"\n"
);
sb
.
append
(
" MEM: "
).
append
(
toIndentedString
(
MEM
)).
append
(
"\n"
);
sb
.
append
(
" MEM: "
).
append
(
toIndentedString
(
MEM
)).
append
(
"\n"
);
sb
.
append
(
" vmType: "
).
append
(
toIndentedString
(
vmType
)).
append
(
"\n"
);
sb
.
append
(
" vmType: "
).
append
(
toIndentedString
(
vmType
)).
append
(
"\n"
);
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
8da728d5
...
@@ -175,7 +175,7 @@ class CloudStormService {
...
@@ -175,7 +175,7 @@ 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
.
setOS
(
os
);
//
cloudsStormVM.setOS(os);
cloudsStormVM
.
setOstype
(
os
);
cloudsStormVM
.
setOstype
(
os
);
vms
.
add
(
cloudsStormVM
);
vms
.
add
(
cloudsStormVM
);
j
++;
j
++;
...
@@ -201,7 +201,7 @@ class CloudStormService {
...
@@ -201,7 +201,7 @@ class CloudStormService {
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
.
getO
S
().
toLowerCase
()))
{
&&
Objects
.
equals
(
memSize
,
Double
.
valueOf
(
vmInfo
.
getMEM
()))
&&
os
.
toLowerCase
().
equals
(
vmInfo
.
getO
stype
().
toLowerCase
()))
{
return
vmInfo
.
getVmType
();
return
vmInfo
.
getVmType
();
}
}
}
}
...
@@ -283,9 +283,9 @@ class CloudStormService {
...
@@ -283,9 +283,9 @@ class CloudStormService {
}
}
private
ToscaTemplate
runCloudStorm
(
String
tempInputDirPath
)
throws
IOException
,
ApiException
{
private
ToscaTemplate
runCloudStorm
(
String
tempInputDirPath
)
throws
IOException
,
ApiException
{
//
String[] args = new String[]{"run", tempInputDirPath};
String
[]
args
=
new
String
[]{
"run"
,
tempInputDirPath
};
//
standalone.MainAsTool.main(args);
standalone
.
MainAsTool
.
main
(
args
);
tempInputDirPath
=
"/tmp/Input-87672007429577"
;
//
tempInputDirPath = "/tmp/Input-87672007429577";
CloudsStormTopTopology
_top
=
objectMapper
.
readValue
(
new
File
(
tempInputDirPath
+
TOPOLOGY_RELATIVE_PATH
CloudsStormTopTopology
_top
=
objectMapper
.
readValue
(
new
File
(
tempInputDirPath
+
TOPOLOGY_RELATIVE_PATH
+
TOP_TOPOLOGY_FILE_NAME
),
+
TOP_TOPOLOGY_FILE_NAME
),
...
...
openAPI/schema/CloudStorm/CloudsStormVM.yml
View file @
8da728d5
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
type
:
object
type
:
object
additionalProperties
:
additionalProperties
:
type
:
object
type
:
object
OS
:
os
:
type
:
"
string"
type
:
"
string"
CPU
:
CPU
:
type
:
"
string"
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