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
5 years ago
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
;
import
com.fasterxml.jackson.annotation.JsonAlias
;
import
java.util.Objects
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -37,6 +38,7 @@ public class CloudsStormVM {
private
String
nodeType
=
null
;
@JsonProperty
(
"OStype"
)
@JsonAlias
({
"os"
,
"OS"
})
private
String
ostype
=
null
;
@JsonProperty
(
"script"
)
...
...
@@ -44,17 +46,17 @@ public class CloudsStormVM {
@JsonProperty
(
"publicAddress"
)
private
String
publicAddress
=
null
;
@JsonProperty
(
"type"
)
private
String
type
=
null
;
//
//
@JsonProperty("type")
//
private String type = null;
@JsonProperty
(
"extraInfo"
)
@Valid
private
Map
<
String
,
Object
>
extraInfo
=
null
;
@JsonProperty
(
"OS"
)
private
String
OS
=
null
;
//
@JsonProperty("OS")
// @JsonAlias({"os", "mybkcat"})
// private String OS = null;
@JsonProperty
(
"CPU"
)
private
String
CPU
=
null
;
...
...
@@ -62,6 +64,7 @@ public class CloudsStormVM {
private
String
MEM
=
null
;
@JsonProperty
(
"VMType"
)
@JsonAlias
({
"type"
})
private
String
vmType
=
null
;
@JsonProperty
(
"Price"
)
...
...
@@ -181,27 +184,26 @@ public class CloudsStormVM {
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 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
;
...
...
@@ -231,27 +233,26 @@ public class CloudsStormVM {
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 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
;
...
...
@@ -392,9 +393,9 @@ public class CloudsStormVM {
&&
Objects
.
equals
(
this
.
ostype
,
cloudsStormVM
.
ostype
)
&&
Objects
.
equals
(
this
.
script
,
cloudsStormVM
.
script
)
&&
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
.
OS
,
cloudsStormVM
.
OS
)
//
&& Objects.equals(this.OS, cloudsStormVM.OS)
&&
Objects
.
equals
(
this
.
CPU
,
cloudsStormVM
.
CPU
)
&&
Objects
.
equals
(
this
.
MEM
,
cloudsStormVM
.
MEM
)
&&
Objects
.
equals
(
this
.
vmType
,
cloudsStormVM
.
vmType
)
...
...
@@ -405,7 +406,7 @@ public class CloudsStormVM {
@Override
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
...
...
@@ -418,9 +419,9 @@ public class CloudsStormVM {
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
(
" type: "
).
append
(
toIndentedString
(
type
)).
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(" 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"
);
...
...
This diff is collapsed.
Click to expand it.
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
8da728d5
...
...
@@ -175,7 +175,7 @@ class CloudStormService {
cloudsStormVM
.
setNodeType
(
vmType
);
cloudsStormVM
.
setName
(
"vm"
+
j
);
String
os
=
helper
.
getVMNOS
(
vmMap
);
cloudsStormVM
.
setOS
(
os
);
//
cloudsStormVM.setOS(os);
cloudsStormVM
.
setOstype
(
os
);
vms
.
add
(
cloudsStormVM
);
j
++;
...
...
@@ -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
,
"numOfCores:{0} memSize: {1} os: {2}"
,
new
Object
[]{
numOfCores
,
memSize
,
os
});
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
();
}
}
...
...
@@ -283,9 +283,9 @@ class CloudStormService {
}
private
ToscaTemplate
runCloudStorm
(
String
tempInputDirPath
)
throws
IOException
,
ApiException
{
//
String[] args = new String[]{"run", tempInputDirPath};
//
standalone.MainAsTool.main(args);
tempInputDirPath
=
"/tmp/Input-87672007429577"
;
String
[]
args
=
new
String
[]{
"run"
,
tempInputDirPath
};
standalone
.
MainAsTool
.
main
(
args
);
//
tempInputDirPath = "/tmp/Input-87672007429577";
CloudsStormTopTopology
_top
=
objectMapper
.
readValue
(
new
File
(
tempInputDirPath
+
TOPOLOGY_RELATIVE_PATH
+
TOP_TOPOLOGY_FILE_NAME
),
...
...
This diff is collapsed.
Click to expand it.
openAPI/schema/CloudStorm/CloudsStormVM.yml
View file @
8da728d5
...
...
@@ -17,7 +17,7 @@
type
:
object
additionalProperties
:
type
:
object
OS
:
os
:
type
:
"
string"
CPU
:
type
:
"
string"
...
...
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