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
03b20b8c
Commit
03b20b8c
authored
Sep 12, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up v0
parent
a9cb2403
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
97 additions
and
656 deletions
+97
-656
application_example_output.yaml
TOSCA/application_example_output.yaml
+1
-1
nodes.yaml
TOSCA/types/nodes.yaml
+2
-5
enunciate.xml
drip-api/enunciate.xml
+1
-4
PlannerService.java
...main/java/nl/uva/sne/drip/api/service/PlannerService.java
+0
-6
ProvisionService.java
...in/java/nl/uva/sne/drip/api/service/ProvisionService.java
+51
-100
SimplePlannerService.java
...ava/nl/uva/sne/drip/api/service/SimplePlannerService.java
+11
-11
PlannerController.java
...n/java/nl/uva/sne/drip/api/v1/rest/PlannerController.java
+20
-20
Converter.java
...rc/main/java/nl/uva/sne/drip/commons/utils/Converter.java
+0
-26
Attribute.java
...uva/sne/drip/drip/commons/data/v0/external/Attribute.java
+0
-51
ConfScript.java
...va/sne/drip/drip/commons/data/v0/external/ConfScript.java
+0
-33
ConfUserKey.java
...a/sne/drip/drip/commons/data/v0/external/ConfUserKey.java
+0
-31
Configure.java
...uva/sne/drip/drip/commons/data/v0/external/Configure.java
+0
-76
Deploy.java
...nl/uva/sne/drip/drip/commons/data/v0/external/Deploy.java
+0
-27
Execute.java
...l/uva/sne/drip/drip/commons/data/v0/external/Execute.java
+0
-45
LoginKey0.java
...uva/sne/drip/drip/commons/data/v0/external/LoginKey0.java
+0
-33
Plan.java
...a/nl/uva/sne/drip/drip/commons/data/v0/external/Plan.java
+0
-50
Register.java
.../uva/sne/drip/drip/commons/data/v0/external/Register.java
+0
-40
Result.java
...nl/uva/sne/drip/drip/commons/data/v0/external/Result.java
+0
-43
Upload.java
...nl/uva/sne/drip/drip/commons/data/v0/external/Upload.java
+0
-33
PlanResponse.java
.../sne/drip/drip/commons/data/v1/external/PlanResponse.java
+10
-14
Consumer.java
...in/java/nl/uva/sne/drip/drip/provisioner/v1/Consumer.java
+1
-7
No files found.
TOSCA/application_example_output.yaml
View file @
03b20b8c
...
@@ -24,7 +24,7 @@ topology_template:
...
@@ -24,7 +24,7 @@ topology_template:
relationship
:
tosca.relationships.DependsOn
relationship
:
tosca.relationships.DependsOn
-
vm
:
-
vm
:
capability
:
tosca.capabilities.ARTICONF.VM
capability
:
tosca.capabilities.ARTICONF.VM
node
:
nancy
_compute
node
:
charles
_compute
relationship
:
tosca.relationships.DependsOn
relationship
:
tosca.relationships.DependsOn
type
:
tosca.nodes.ARTICONF.VM.topology
type
:
tosca.nodes.ARTICONF.VM.topology
charles_compute
:
charles_compute
:
...
...
TOSCA/types/nodes.yaml
View file @
03b20b8c
...
@@ -106,9 +106,6 @@ node_types:
...
@@ -106,9 +106,6 @@ node_types:
os
:
os
:
type
:
string
type
:
string
required
:
true
required
:
true
ssh_key
:
type
:
string
required
:
false
interfaces
:
interfaces
:
Standard
:
Standard
:
create
:
dumy.yaml
create
:
dumy.yaml
...
...
drip-api/enunciate.xml
View file @
03b20b8c
...
@@ -8,13 +8,10 @@
...
@@ -8,13 +8,10 @@
<api-classes>
<api-classes>
<include
pattern=
"nl.uva.sne.drip.api.v1.rest.*"
/>
<include
pattern=
"nl.uva.sne.drip.api.v1.rest.*"
/>
<include
pattern=
"nl.uva.sne.drip.api.v0.rest.*"
/>
</api-classes>
</api-classes>
<api-import
pattern=
"nl.uva.sne.drip.drip.commons.data.v1.external.*"
/>
<api-import
pattern=
"nl.uva.sne.drip.drip.commons.data.v1.external.*"
/>
<api-import
pattern=
"nl.uva.sne.drip.drip.commons.data.v1.external.ansible.*"
/>
<api-import
pattern=
"nl.uva.sne.drip.drip.commons.data.v1.external.ansible.*"
/>
<api-import
pattern=
"nl.uva.sne.drip.drip.commons.data.v0.external.*"
/>
<modules>
<modules>
<swagger
disabled=
"true"
/>
<swagger
disabled=
"true"
/>
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/PlannerService.java
View file @
03b20b8c
...
@@ -201,12 +201,6 @@ public class PlannerService {
...
@@ -201,12 +201,6 @@ public class PlannerService {
if
(
plan
==
null
)
{
if
(
plan
==
null
)
{
throw
new
NotFoundException
();
throw
new
NotFoundException
();
}
}
Set
<
String
>
lowIds
=
plan
.
getLoweLevelPlanIDs
();
if
(
lowIds
!=
null
)
{
for
(
String
lId
:
lowIds
)
{
planDao
.
delete
(
lId
);
}
}
planDao
.
delete
(
plan
);
planDao
.
delete
(
plan
);
return
plan
;
return
plan
;
}
}
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/ProvisionService.java
View file @
03b20b8c
...
@@ -26,7 +26,6 @@ import java.util.HashMap;
...
@@ -26,7 +26,6 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Properties
;
import
java.util.Set
;
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
;
...
@@ -38,7 +37,6 @@ import nl.uva.sne.drip.api.exception.ExceptionHandler;
...
@@ -38,7 +37,6 @@ import nl.uva.sne.drip.api.exception.ExceptionHandler;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.exception.PlanNotFoundException
;
import
nl.uva.sne.drip.api.exception.PlanNotFoundException
;
import
nl.uva.sne.drip.api.rpc.DRIPCaller
;
import
nl.uva.sne.drip.api.rpc.DRIPCaller
;
import
nl.uva.sne.drip.api.rpc.ProvisionerCaller0
;
import
nl.uva.sne.drip.api.v1.rest.ProvisionController
;
import
nl.uva.sne.drip.api.v1.rest.ProvisionController
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.CloudCredentials
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.CloudCredentials
;
...
@@ -48,9 +46,7 @@ import nl.uva.sne.drip.drip.commons.data.internal.MessageParameter;
...
@@ -48,9 +46,7 @@ import nl.uva.sne.drip.drip.commons.data.internal.MessageParameter;
import
nl.uva.sne.drip.drip.commons.data.v1.external.PlanResponse
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.PlanResponse
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ProvisionRequest
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ProvisionRequest
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ProvisionResponse
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ProvisionResponse
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.Script
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.User
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.User
;
import
org.apache.commons.io.FilenameUtils
;
import
org.json.JSONException
;
import
org.json.JSONException
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.access.prepost.PostAuthorize
;
import
org.springframework.security.access.prepost.PostAuthorize
;
...
@@ -192,32 +188,6 @@ public class ProvisionService {
...
@@ -192,32 +188,6 @@ public class ProvisionService {
}
}
// private List<MessageParameter> buildCertificatesParam(CloudCredentials cred) {
//// List<String> loginKeysIDs = cred.getkeyPairIDs();
// List<KeyPair> loginKeys = new ArrayList<>();
//// for (String keyID : loginKeysIDs) {
//// KeyPair key = keyDao.findOne(keyID);
//// loginKeys.add(key);
//// }
// if (loginKeys.isEmpty()) {
// throw new BadRequestException("Log in keys can't be empty");
// }
// List<MessageParameter> parameters = new ArrayList<>();
// for (KeyPair lk : loginKeys) {
// String domainName = lk.getPrivateKey().getAttributes().get("domain_name");
// if (domainName == null) {
// domainName = lk.getPrivateKey().getAttributes().get("domain_name ");
// }
// MessageParameter cert = new MessageParameter();
// cert.setName("certificate");
// cert.setValue(lk.getPrivateKey().getKey());
// Map<String, String> attributes = new HashMap<>();
// attributes.put("filename", domainName);
// cert.setAttributes(attributes);
// parameters.add(cert);
// }
// return parameters;
// }
private
List
<
MessageParameter
>
buildTopologyParams
(
String
planID
)
throws
JSONException
,
FileNotFoundException
{
private
List
<
MessageParameter
>
buildTopologyParams
(
String
planID
)
throws
JSONException
,
FileNotFoundException
{
PlanResponse
plan
=
simplePlanService
.
getDao
().
findOne
(
planID
);
PlanResponse
plan
=
simplePlanService
.
getDao
().
findOne
(
planID
);
...
@@ -232,27 +202,8 @@ public class ProvisionService {
...
@@ -232,27 +202,8 @@ public class ProvisionService {
String
encodedValue
=
new
String
(
Base64
.
encodeBase64
(
val
.
getBytes
()));
String
encodedValue
=
new
String
(
Base64
.
encodeBase64
(
val
.
getBytes
()));
topology
.
setValue
(
encodedValue
);
topology
.
setValue
(
encodedValue
);
Map
<
String
,
String
>
attributes
=
new
HashMap
<>();
Map
<
String
,
String
>
attributes
=
new
HashMap
<>();
// attributes.put("level", String.valueOf(plan.getLevel()));
// attributes.put("filename", FilenameUtils.removeExtension(plan.getName()));
topology
.
setAttributes
(
attributes
);
topology
.
setAttributes
(
attributes
);
parameters
.
add
(
topology
);
parameters
.
add
(
topology
);
// Set<String> ids = plan.getLoweLevelPlanIDs();
// if (ids != null) {
// for (String lowID : ids) {
// PlanResponse lowPlan = simplePlanService.getDao().findOne(lowID);
// topology = new MessageParameter();
// topology.setName("topology");
// String value = Converter.map2YmlString(lowPlan.getKeyValue());
// value = value.replaceAll("\\uff0E", ".");
// topology.setValue(value);
// attributes = new HashMap<>();
//// attributes.put("level", String.valueOf(lowPlan.getLevel()));
//// attributes.put("filename", FilenameUtils.removeExtension(lowPlan.getName()));
// topology.setAttributes(attributes);
// parameters.add(topology);
// }
// }
return
parameters
;
return
parameters
;
}
}
...
@@ -280,63 +231,63 @@ public class ProvisionService {
...
@@ -280,63 +231,63 @@ public class ProvisionService {
private
List
<
MessageParameter
>
buildClusterKeyParams
(
ProvisionResponse
provisionInfo
)
{
private
List
<
MessageParameter
>
buildClusterKeyParams
(
ProvisionResponse
provisionInfo
)
{
List
<
MessageParameter
>
parameters
=
new
ArrayList
();
List
<
MessageParameter
>
parameters
=
new
ArrayList
();
List
<
String
>
ids
=
provisionInfo
.
getDeployerKeyPairIDs
();
//
List<String> ids = provisionInfo.getDeployerKeyPairIDs();
for
(
String
id
:
ids
)
{
//
for (String id : ids) {
KeyPair
pair
=
keyPairService
.
findOne
(
id
);
//
KeyPair pair = keyPairService.findOne(id);
//
MessageParameter
param
=
new
MessageParameter
();
//
MessageParameter param = new MessageParameter();
param
.
setName
(
"private_deployer_key"
);
//
param.setName("private_deployer_key");
param
.
setValue
(
pair
.
getPrivateKey
().
getKey
());
//
param.setValue(pair.getPrivateKey().getKey());
HashMap
<
String
,
String
>
attributes
=
new
HashMap
<>();
//
HashMap<String, String> attributes = new HashMap<>();
if
(
pair
.
getPrivateKey
()
!=
null
&&
pair
.
getPrivateKey
().
getAttributes
()
!=
null
)
{
//
if (pair.getPrivateKey() != null && pair.getPrivateKey().getAttributes() != null) {
attributes
.
putAll
(
pair
.
getPrivateKey
().
getAttributes
());
//
attributes.putAll(pair.getPrivateKey().getAttributes());
}
//
}
attributes
.
put
(
"name"
,
pair
.
getPrivateKey
().
getName
());
//
attributes.put("name", pair.getPrivateKey().getName());
param
.
setAttributes
(
attributes
);
//
param.setAttributes(attributes);
parameters
.
add
(
param
);
//
parameters.add(param);
//
param
=
new
MessageParameter
();
//
param = new MessageParameter();
param
.
setName
(
"public_deployer_key"
);
//
param.setName("public_deployer_key");
param
.
setValue
(
pair
.
getPublicKey
().
getKey
());
//
param.setValue(pair.getPublicKey().getKey());
attributes
=
new
HashMap
<>();
//
attributes = new HashMap<>();
if
(
pair
.
getPublicKey
()
!=
null
&&
pair
.
getPublicKey
().
getAttributes
()
!=
null
)
{
//
if (pair.getPublicKey() != null && pair.getPublicKey().getAttributes() != null) {
attributes
.
putAll
(
pair
.
getPublicKey
().
getAttributes
());
//
attributes.putAll(pair.getPublicKey().getAttributes());
}
//
}
param
.
setAttributes
(
attributes
);
//
param.setAttributes(attributes);
attributes
.
put
(
"name"
,
pair
.
getPublicKey
().
getName
());
//
attributes.put("name", pair.getPublicKey().getName());
parameters
.
add
(
param
);
//
parameters.add(param);
}
//
}
return
parameters
;
return
parameters
;
}
}
private
List
<
MessageParameter
>
buildUserKeyParams
(
ProvisionResponse
provisionInfo
)
{
private
List
<
MessageParameter
>
buildUserKeyParams
(
ProvisionResponse
provisionInfo
)
{
List
<
MessageParameter
>
parameters
=
new
ArrayList
();
List
<
MessageParameter
>
parameters
=
new
ArrayList
();
List
<
String
>
ids
=
provisionInfo
.
getUserKeyPairIDs
();
//
List<String> ids = provisionInfo.getUserKeyPairIDs();
for
(
String
id
:
ids
)
{
//
for (String id : ids) {
KeyPair
pair
=
keyPairService
.
findOne
(
id
);
//
KeyPair pair = keyPairService.findOne(id);
//
MessageParameter
param
=
new
MessageParameter
();
//
MessageParameter param = new MessageParameter();
param
.
setName
(
"private_user_key"
);
//
param.setName("private_user_key");
param
.
setValue
(
pair
.
getPrivateKey
().
getKey
());
//
param.setValue(pair.getPrivateKey().getKey());
HashMap
<
String
,
String
>
attributes
=
new
HashMap
<>();
//
HashMap<String, String> attributes = new HashMap<>();
if
(
pair
.
getPrivateKey
().
getAttributes
()
!=
null
)
{
//
if (pair.getPrivateKey().getAttributes() != null) {
attributes
.
putAll
(
pair
.
getPrivateKey
().
getAttributes
());
//
attributes.putAll(pair.getPrivateKey().getAttributes());
}
//
}
attributes
.
put
(
"name"
,
pair
.
getPrivateKey
().
getName
());
//
attributes.put("name", pair.getPrivateKey().getName());
param
.
setAttributes
(
attributes
);
//
param.setAttributes(attributes);
parameters
.
add
(
param
);
//
parameters.add(param);
//
param
=
new
MessageParameter
();
//
param = new MessageParameter();
param
.
setName
(
"public_user_key"
);
//
param.setName("public_user_key");
param
.
setValue
(
pair
.
getPublicKey
().
getKey
());
//
param.setValue(pair.getPublicKey().getKey());
if
(
pair
.
getPublicKey
().
getAttributes
()
!=
null
)
{
//
if (pair.getPublicKey().getAttributes() != null) {
attributes
.
putAll
(
pair
.
getPublicKey
().
getAttributes
());
//
attributes.putAll(pair.getPublicKey().getAttributes());
}
//
}
attributes
.
put
(
"name"
,
pair
.
getPublicKey
().
getName
());
//
attributes.put("name", pair.getPublicKey().getName());
param
.
setAttributes
(
attributes
);
//
param.setAttributes(attributes);
parameters
.
add
(
param
);
//
parameters.add(param);
}
//
}
return
parameters
;
return
parameters
;
}
}
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/SimplePlannerService.java
View file @
03b20b8c
...
@@ -64,10 +64,10 @@ public class SimplePlannerService {
...
@@ -64,10 +64,10 @@ public class SimplePlannerService {
Message
plannerReturnedMessage
=
(
planner
.
call
(
plannerInvokationMessage
));
Message
plannerReturnedMessage
=
(
planner
.
call
(
plannerInvokationMessage
));
List
<
MessageParameter
>
planFiles
=
plannerReturnedMessage
.
getParameters
();
List
<
MessageParameter
>
planFiles
=
plannerReturnedMessage
.
getParameters
();
topLevel
=
new
PlanResponse
();
topLevel
=
new
PlanResponse
();
Set
<
String
>
ids
=
topLevel
.
getLoweLevelPlanIDs
();
//
Set<String> ids = topLevel.getLoweLevelPlanIDs();
if
(
ids
==
null
)
{
//
if (ids == null) {
ids
=
new
HashSet
<>();
//
ids = new HashSet<>();
}
//
}
PlanResponse
lowerLevelPlan
=
null
;
PlanResponse
lowerLevelPlan
=
null
;
for
(
MessageParameter
p
:
planFiles
)
{
for
(
MessageParameter
p
:
planFiles
)
{
//Should have levels in attributes
//Should have levels in attributes
...
@@ -87,10 +87,10 @@ public class SimplePlannerService {
...
@@ -87,10 +87,10 @@ public class SimplePlannerService {
lowerLevelPlan
.
setKvMap
(
Converter
.
ymlString2Map
(
p
.
getValue
()));
lowerLevelPlan
.
setKvMap
(
Converter
.
ymlString2Map
(
p
.
getValue
()));
// lowerLevelPlan.setLevel(1);
// lowerLevelPlan.setLevel(1);
planDao
.
save
(
lowerLevelPlan
);
planDao
.
save
(
lowerLevelPlan
);
ids
.
add
(
lowerLevelPlan
.
getId
());
//
ids.add(lowerLevelPlan.getId());
}
}
}
}
topLevel
.
setLoweLevelPlansIDs
(
ids
);
//
topLevel.setLoweLevelPlansIDs(ids);
}
}
topLevel
.
setToscaID
(
toscaId
);
topLevel
.
setToscaID
(
toscaId
);
planDao
.
save
(
topLevel
);
planDao
.
save
(
topLevel
);
...
@@ -135,11 +135,11 @@ public class SimplePlannerService {
...
@@ -135,11 +135,11 @@ public class SimplePlannerService {
}
}
Map
<
String
,
Object
>
map
=
plan
.
getKeyValue
();
Map
<
String
,
Object
>
map
=
plan
.
getKeyValue
();
Set
<
String
>
ids
=
plan
.
getLoweLevelPlanIDs
();
//
Set<String> ids = plan.getLoweLevelPlanIDs();
for
(
String
lowID
:
ids
)
{
//
for (String lowID : ids) {
Map
<
String
,
Object
>
lowLevelMap
=
planDao
.
findOne
(
lowID
).
getKeyValue
();
//
Map<String, Object> lowLevelMap = planDao.findOne(lowID).getKeyValue();
map
.
putAll
(
lowLevelMap
);
//
map.putAll(lowLevelMap);
}
//
}
if
(
fromat
!=
null
&&
fromat
.
equals
(
"yml"
))
{
if
(
fromat
!=
null
&&
fromat
.
equals
(
"yml"
))
{
String
ymlStr
=
Converter
.
map2YmlString
(
map
);
String
ymlStr
=
Converter
.
map2YmlString
(
map
);
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/PlannerController.java
View file @
03b20b8c
...
@@ -197,25 +197,25 @@ public class PlannerController {
...
@@ -197,25 +197,25 @@ public class PlannerController {
return
plannerService
.
saveStringContents
(
toscaContents
,
0
,
name
);
return
plannerService
.
saveStringContents
(
toscaContents
,
0
,
name
);
}
}
@RequestMapping
(
value
=
"/post/{level}/{name}/{id}"
,
method
=
RequestMethod
.
POST
)
//
@RequestMapping(value = "/post/{level}/{name}/{id}", method = RequestMethod.POST)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
//
@RolesAllowed({UserService.USER, UserService.ADMIN})
public
@ResponseBody
//
public @ResponseBody
String
postLow
(
@RequestBody
String
toscaContents
,
@PathVariable
(
"level"
)
String
level
,
@PathVariable
(
"name"
)
String
name
,
@PathVariable
(
"id"
)
String
id
)
{
//
String postLow(@RequestBody String toscaContents, @PathVariable("level") String level, @PathVariable("name") String name, @PathVariable("id") String id) {
int
intLevel
=
Integer
.
valueOf
(
level
);
//
int intLevel = Integer.valueOf(level);
if
(
intLevel
==
0
)
{
//
if (intLevel == 0) {
return
plannerService
.
saveStringContents
(
toscaContents
,
0
,
name
);
//
return plannerService.saveStringContents(toscaContents, 0, name);
}
//
}
//
PlanResponse
topPlan
=
plannerService
.
findOne
(
id
);
//
PlanResponse topPlan = plannerService.findOne(id);
Set
<
String
>
lowIDs
=
topPlan
.
getLoweLevelPlanIDs
();
//
Set<String> lowIDs = topPlan.getLoweLevelPlanIDs();
if
(
lowIDs
==
null
)
{
//
if (lowIDs == null) {
lowIDs
=
new
HashSet
<>();
//
lowIDs = new HashSet<>();
}
//
}
String
lowPlanID
=
plannerService
.
saveStringContents
(
toscaContents
,
intLevel
,
name
);
//
String lowPlanID = plannerService.saveStringContents(toscaContents, intLevel, name);
lowIDs
.
add
(
lowPlanID
);
//
lowIDs.add(lowPlanID);
topPlan
.
setLoweLevelPlansIDs
(
lowIDs
);
//
topPlan.setLoweLevelPlansIDs(lowIDs);
topPlan
=
plannerService
.
save
(
topPlan
);
//
topPlan = plannerService.save(topPlan);
return
topPlan
.
getId
();
//
return topPlan.getId();
}
//
}
}
}
drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/Converter.java
View file @
03b20b8c
...
@@ -36,7 +36,6 @@ import org.yaml.snakeyaml.Yaml;
...
@@ -36,7 +36,6 @@ import org.yaml.snakeyaml.Yaml;
import
nl.uva.sne.drip.drip.commons.data.internal.Message
;
import
nl.uva.sne.drip.drip.commons.data.internal.Message
;
import
nl.uva.sne.drip.drip.commons.data.internal.MessageParameter
;
import
nl.uva.sne.drip.drip.commons.data.internal.MessageParameter
;
import
nl.uva.sne.drip.drip.commons.data.v0.external.Attribute
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.PlanResponse
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.PlanResponse
;
/**
/**
...
@@ -209,31 +208,6 @@ public class Converter {
...
@@ -209,31 +208,6 @@ public class Converter {
return
mess
;
return
mess
;
}
}
public
static
Attribute
plan1toFile
(
PlanResponse
plan1
)
throws
JSONException
{
Attribute
e
=
new
Attribute
();
// e.level = String.valueOf(plan1.getLevel());
// String p1Name = FilenameUtils.getBaseName(plan1.getName());
// if (p1Name == null) {
// p1Name = "Planned_tosca_file_" + plan1.getLevel();
// plan1.setName(p1Name);
// }
// e.name = p1Name;
String
ymlString
=
Converter
.
map2YmlString
(
plan1
.
getKeyValue
());
e
.
content
=
ymlString
.
replaceAll
(
"\n"
,
"\\\\n"
);
return
e
;
}
public
static
PlanResponse
File2Plan1
(
Attribute
p0
)
{
PlanResponse
p1
=
new
PlanResponse
();
// p1.setLevel(Integer.valueOf(p0.level));
// p1.setName(p0.name);
String
yaml
=
p0
.
content
.
replaceAll
(
"\\\\n"
,
"\n"
);
p1
.
setKvMap
(
ymlString2Map
(
yaml
));
return
p1
;
}
public
static
Map
<
String
,
Object
>
cleanStringContents
(
String
ymlContents
,
boolean
removeNewLine
)
{
public
static
Map
<
String
,
Object
>
cleanStringContents
(
String
ymlContents
,
boolean
removeNewLine
)
{
if
(
removeNewLine
)
{
if
(
removeNewLine
)
{
//Remove '\' and 'n' if they are together and replace them with '\n'
//Remove '\' and 'n' if they are together and replace them with '\n'
...
...
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v0/external/Attribute.java
deleted
100644 → 0
View file @
a9cb2403
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
data
.
v0
.
external
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.bind.annotation.XmlValue
;
/**
*
* @author S. Koulouzis
*/
public
class
Attribute
{
/**
* Name of the file/public key.
*/
@DocumentationExample
(
"planner_output_all"
)
@XmlAttribute
public
String
name
;
/**
* There are two levels of description files for topologies designed by users.
* If the level attribute for the element file is 1, then this file is the top-level description,
* which defines how the sub-topologies are connected to each other.
* If the level attribute is 0, then the file is the low-level description,
* which describes the topology in one data center in detail.
* On the other hand, the name of low-level description file must be the
* sub-topology name appeared in the high-level description file. (For example, here should be zh_a and zh_b.)
*/
@DocumentationExample
(
"0"
)
@XmlAttribute
public
String
level
;
@XmlValue
public
String
content
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v0/external/ConfScript.java
deleted
100644 → 0
View file @
a9cb2403
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
data
.
v0
.
external
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
*
* @author S. Koulouzis
*/
@XmlRootElement
public
class
ConfScript
extends
Execute
{
/**
* The script contents with new lines replace by '\n'
*/
@DocumentationExample
(
"#!/bin/bash\\n\\nlogstashScript=/root/runLogstash.sh\\nscreen -S logstash -dm /bin/bash \"$logstashScript\"\\n\\n\\nlogLevelPath=/root/\\nlogLevelFile=$logLevelPath/logstash_loglevel.csv\\nremotePath=/media/lobcder/skoulouz/\\nremoteLogPath=$remotePath/logs\\nlocalLogPath=/root/logs\\n\\nmkdir $localLogPath\\n\\n\\nfor logArchPath in $remoteLogPath/*.gz; do\\n echo \"File -> $logArchPath\"\\n if [ ! -f $logArchPath.lock ]; then\\n touch $logArchPath.lock\\n cp $logArchPath $localLogPath\\n logArchName=$(basename $logArchPath)\\n tar -xvf $localLogPath/$logArchName -C $localLogPath\\n sleep 120\\n modTime=-100\\n while [ ! -f $logLevelFile ]\\n do\\n sleep 5\\n done\\n while [ $modTime -lt 120 ]\\n do\\n moddate=$(stat -c %Y $logLevelFile)\\n moddate=${moddate%% *}\\n now=$(date +%s)\\n modTime=\"$(( $now - $moddate))\"\\n echo $modTime\\n sleep 5\\n done\\n rm $localLogPath/*.tar.gz\\n rm $localLogPath/*.log\\n modTime=-100\\n fi\\ndone\\n \\n\\nscreen -X -S logstash quit\\nsleep 5\\n\\nuid=`ifconfig | grep eth0 | awk '{print $NF}' | sed 's/://g'`\\n\\nfor csvFiles in $logLevelPath/*.csv; do\\n echo $csvFiles $csvFiles$uid.csv\\n mv $csvFiles $csvFiles$uid.csv\\n cp $csvFiles$uid.csv $remotePath\\ndone\\n\\nkillall java \\n"
)
public
String
script
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v0/external/ConfUserKey.java
deleted
100644 → 0
View file @
a9cb2403
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
data
.
v0
.
external
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
*
* @author S. Koulouzis
*/
@XmlRootElement
public
class
ConfUserKey
extends
Execute
{
@XmlElement
(
name
=
"userKey"
)
public
List
<
Attribute
>
file
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v0/external/Configure.java
deleted
100644 → 0
View file @
a9cb2403
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
data
.
v0
.
external
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
*
* @author S. Koulouzis
*/
@XmlRootElement
public
class
Configure
{
/**
* Not used. It's there for backwards compatibility.
*/
@DocumentationExample
(
"user"
)
public
String
user
;
/**
* Not used. It's there for backwards compatibility.
*/
@DocumentationExample
(
"123"
)
public
String
pwd
;
/**
* The key id for the cloud provider.
*
*/
@DocumentationExample
(
"AKIAITY3K5ZUQ6M7YBSQ"
)
public
String
keyid
;
/**
* The key for the cloud provider.
*/
@DocumentationExample
(
"6J7uo99ifrff45126Gsy5vgb3bmrtwY6hBxtYt9y"
)
public
String
key
;
@XmlElement
(
name
=
"loginKey"
)
public
List
<
LoginKey0
>
loginKey
;
/**
* The binary keystore (user.jks) for the cloud provider encoded in base64
*/
@DocumentationExample
(
"/u3+7QAAAAIAAAABAWuf2AAACvDCCArgwDgYKKwYBBEBAQUABIIC\\npKlNUfpKLNCy0h8P4L5XeECwwIN/tezeaOVsjvzLsXeiBsB/luYv9gttoeKFbcJb/IDpZr\\nfpL1tjF8Sed6g38kNoWwnVVoNZ1ILpITjESL6FkZW+gGAPS+XHp8l52/2DjeECQlx+38GlFUftWP\\nn3QH9bDYD+7sRtm4P0YWnekX67ltQHMV+Cyrg0HAFm+GUzJJoxu64MccURLBMw0If9gCmTOuVoRj\\nprPukU+cMY8torQ3+WmzC0S6U10HjQ2AkJ80HwM6CcS82qflHIBfQ/o7ep76rCDN22widcLGOihU\\nbJiNQtNdF6KRCJk0emVIvRHDHctsmmt2ao2Qx6ub2mA/eUZtlphHMVN5VQtSxdd87tKrH9FvaOe3\\nGX/irmBBopS2mfFee4LPn3FT/F5bl9YunygX3sWLGNsCl8G15hzgSSVn4As37czUulj8hks/Qpvu\\nqoVpegs2+m5mXbSMmif+cUPqyJZ8UL5slIGZMKQ7MJG1XVG6vFIHk3cS+L+NpDd2j8DZqBP5FXIO\\nCt/IxZxR2ZfPHHmIbOhwdnaznOoyAEGDzFTXnyTClGTDTW/6zxOe/ynNPlnBQaNqVJYqPtFG4AVs\\nhrSNuvYjm1xsVDROQI5LYF/nryU4VvqMTo2sjVP2g6Qw7E5ENWiYUAl2W+bk4H6WGDTdQgLm2J65\\ngdZpQTQtubzWi8Fxrptqul5eq96l0xH15XQ9lBKV0J8PEMa1jKOW/9s2U++hAtKTixssVntaNyUY\\n9dnXNYHnQRKXDrQr/izerNEhvlVcz6foWDurtjAIjxafyEBbXJ5TAyT4rxmkPxDg88LPXKCzpf1x\\n3WwD8MBUNBC9nfB37rHxEl7StvnK3IXBHmEksg7X6xhmUsrsQo8mfP05XDmqt+lsiYoAAAACAAVY\\nLjUwOQAAAz8wggM7MIICpKADAgECAgJFBDANBgkqhkiG9w0BAQUFADCBiTEUMBIGA1UEChMLY2gu\\nZ2VuaS5uZXQxEjAQBgNVBAsTCWF1dGhvcml0eTELMAkGA1UECxMCbWExLTArBgNVBAMTJDMxYzBm\\nMDlmLTk1ZjctNDUxMC1hMzBiLWQ5M2RmMmJkMDJjOTEhMB8GCSqGSIb3DQEJARYSY2gtYWRtaW5z\\nQGdlbmkubmV0MB4XDTE3MDEyNTE0NTY0OVoXDTE4MDEyNTE0NTY0OVowUjEtMCsGA1UEAxMkYmY4\\nYThhNTQtN2FjOS00NTEzLWIyZTItYjJjN2U2YWUwMDVkMSEwHwYJKoZIhvcNAQkBFhJzLmtvdWxv\\ndXppc0B1dmEubmwwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANmwnBJETSZSQm67FxQHL0s6\\n84SYlYh6ltgi8DfwRu/wMA8sL5PsuupNvgKJCVHHZzPVwIrUy8JxpFrX3BItaDX+VPR+6sBJqUan\\nBeb3vojU6CyEZzwCAOhn9OxB8ZFyoMD6SwsykPBOeXhGKpWsOoBwQDx8i6xpto1AP3KY8DpxAgMB\\nAAGjgecwgeQwHQYDVR0OBBYEFNTBvaP5OnG0h8exiS8Ob0ZvfF8FMD4GA1UdIwQ3MDWAFHGlguYe\\n8bTQK4umhY/oGl1ifTGuoRqkGDAWMRQwEgYDVQQDEwtjaC5nZW5pLm5ldIIBAzAJBgNVHRMEAjAA\\nMHgGA1UdEQRxMG+BEnMua291bG91emlzQHV2YS5ubIYqdXJuOnB1YmxpY2lkOklETitjaC5nZW5p\\nLm5ldCt1c2VyK3Nrb3Vsb3V6hi11cm46dXVpZDpiZjhhOGE1NC03YWM5LTQ1MTMtYjJlMi1iMmM3\\nZTZhZTAwNWQwDQYJKoZIhvcNAQEFBQADgYEAP/9ihMCaalsPRBMDozgX2Wd6eFCNYuDIMFTeNkKa\\nkWJp156oQ4iAmbtP2R9r4W02gjEQRtUxvBhYI2Rp32wl1ZLdpSwnuZAE1H89dIHTct48VkiI1Zp9\\n5BtV4olBUAf2K2hd46pH3ObUAYZvWQGoT+oOlfcacAaEUNp01afC8voABVguNTA5AAADUzCCA08w\\nggK4oAMCAQICAQMwDQYJKoZIhvcNAQEFBQAwFjEUMBIGA1UEAxMLY2guZ2VuaS5uZXQwHhcNMTMw\\nNTIwMTMxODI3WhcNMTgwNTE5MTMxODI3WjCBiTEUMBIGA1UEChMLY2guZ2VuaS5uZXQxEjAQBgNV\\nBAsTCWF1dGhvcml0eTELMAkGA1UECxMCbWExLTArBgNVBAMTJDMxYzBmMDlmLTk1ZjctNDUxMC1h\\nMzBiLWQ5M2RmMmJkMDJjOTEhMB8GCSqGSIb3DQEJARYSY2gtYWRtaW5zQGdlbmkubmV0MIGfMA0G\\nCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4LG9Xl2veo5+Zy1fDi47ajinYu+mv8QYDya2Hf8lPolQy\\nlnGFFQRMx/JsbG1BBQ86FqSeUWtvANhY1nRlrozutOBeg9EEfhX+JXvVdhEKQ4/ANliC0V1UR3GO\\nJHtQaj/6qoG/q01bWP7EJgf+ZPfTdCgCkJ89v8oth1m3UjCxcQIDAQABo4IBNzCCATMwHQYDVR0O\\nBBYEFHGlguYe8bTQK4umhY/oGl1ifTGuMEYGA1UdIwQ/MD2AFEU22V1Y/0L1KwlqbnkdPIMEy5hR\\noRqkGDAWMRQwEgYDVQQDEwtjaC5nZW5pLm5ldIIJAJvH3dZoB97bMEcGCCsGAQUFBwEBBDswOTA3\\nBhRpg8yTgKiYzKjHvbGngICqrteKG4YfaHR0cHM6Ly9jaC5nZW5pLm5ldC9jYWluZm8uaHRtbDBz\\nBgNVHREEbDBqgRJjaC1hZG1pbnNAZ2VuaS5uZXSGKXVybjpwdWJsaWNpZDpJRE4rY2guZ2VuaS5u\\nZXQrYXV0aG9yaXR5K21hhil1dWlkOjMxYzBmMDlmLTk1ZjctNDUxMC1hMzBiLWQ5M2RmMmJkMDJj\\nOTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAHgrtROjbfUT6HQCZCl1XuAEZQPse3/x\\nT2smC3LzAH4UUj3gEBq27VvxbqzazdBQCSeBEl2RUd+KoDzmhG5vBbAyHt8UE6s3P7Yx\\ngoNYTld0JHB5wq3XFRaaGbeVgo2AuK9S/Q3whzMTRW21a58tLP5zwKGzX3oyQQUT5J\\ncwv0z5NmJdAfk8Y="
)
public
String
geniKey
;
/**
* Key alias in key store
*/
@DocumentationExample
(
"exogeni"
)
public
String
geniKeyAlias
;
@XmlElement
(
name
=
"loginPubKey"
)
public
List
<
LoginKey0
>
loginPubKey
;
public
String
geniKeyPass
;
@XmlElement
(
name
=
"loginPriKey"
)
public
List
<
LoginKey0
>
loginPriKey
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v0/external/Deploy.java
deleted
100644 → 0
View file @
a9cb2403
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
data
.
v0
.
external
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
*
* @author S. Koulouzis
*/
@XmlRootElement
public
class
Deploy
extends
Execute
{
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v0/external/Execute.java
deleted
100644 → 0
View file @
a9cb2403
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
data
.
v0
.
external
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
*
* @author S. Koulouzis
*/
@XmlRootElement
public
class
Execute
{
/**
* Not used. It's there for backwards compatibility.
*/
@DocumentationExample
(
"user"
)
public
String
user
;
/**
* Not used. It's there for backwards compatibility.
*/
@DocumentationExample
(
"123"
)
public
String
pwd
;
/**
* A referance id used from the servcie to do the provisioning
*/
@DocumentationExample
(
"58c2c2f3a8d4b56889878d03"
)
public
String
action
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v0/external/LoginKey0.java
deleted
100644 → 0
View file @
a9cb2403
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
data
.
v0
.
external
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.bind.annotation.XmlValue
;
/**
*
* @author S. Koulouzis
*/
public
class
LoginKey0
{
@XmlAttribute
(
name
=
"domain_name"
)
public
String
domain_name
;
@XmlValue
public
String
content
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v0/external/Plan.java
deleted
100644 → 0
View file @
a9cb2403
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
data
.
v0
.
external
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
java.io.Serializable
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
*
* This class represents a plan to be provided to the planner.
*
* @author S. Koulouzis
*/
@XmlRootElement
public
class
Plan
implements
Serializable
{
/**
* Not used. It's only there for backwords compatibility
*/
@DocumentationExample
(
"user"
)
public
String
user
;
/**
* Not used. It's only there for backwords compatibility
*/
@DocumentationExample
(
"123"
)
public
String
pwd
;
/**
* The contents of the TOSCA description
*/
@DocumentationExample
(
"tosca_definitions_version: tosca_simple_yaml_1_0\\n\\n\\ndescription: example file for infrastructure planner\\n\\n\\nrepositories:\\n MOG_docker_hub: \\n description: MOG project’s code repository in GitHub\\n url: https://github.com/switch-project/mog\\n credential:\\n protocol: xauth\\n token_type: X-Auth-Token\\n # token encoded in Base64\\n token: 604bbe45ac7143a79e14f3158df67091\\n\\n\\nartifact_types:\\n tosca.artifacts.Deployment.Image.Container.Docker:\\n derived_from: tosca.artifacts.Deployment.Image\\n\\n\\ndata_types:\\n Switch.datatypes.QoS.AppComponent:\\n derived_from: tosca.datatypes.Root\\n properties:\\n response_time:\\n type: string\\n\\n Switch.datatypes.Application.Connection.EndPoint:\\n derived_from: tosca.datatypes.Root\\n properties:\\n address:\\n type: string\\n component_name:\\n type: string\\n netmask:\\n type: string\\n port_name:\\n type: string\\n\\n Switch.datatypes.Application.Connection.Multicast:\\n derived_from: tosca.datatypes.Root\\n properties:\\n multicastAddrIP:\\n type: string\\n multicastAddrPort:\\n type: integer\\n\\n Switch.datatypes.Network.EndPoint:\\n derived_from: tosca.datatypes.Root\\n properties:\\n address:\\n type: string\\n host_name:\\n type: string\\n netmask:\\n type: string\\n port_name:\\n type: string\\n\\n Switch.datatypes.Network.Multicast:\\n derived_from: tosca.datatypes.Root\\n properties:\\n multicastAddrIP:\\n type: string\\n multicastAddrPort:\\n type: integer\\n\\n\\nnode_types:\\n\\n Switch.nodes.Application.Container.Docker:\\n derived_from: tosca.nodes.Container.Application\\n properties:\\n QoS:\\n type: Switch.datatypes.QoS.AppComponent\\n artifacts:\\n docker_image:\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n interfaces:\\n Standard:\\n create:\\n inputs:\\n command:\\n type: string\\n exported_ports:\\n type: list\\n entry_schema:\\n type: string\\n port_bindings:\\n type: list\\n entry_schema:\\n type: string\\n\\n Switch.nodes.Application.Container.Docker.MOG.InputDistributor:\\n derived_from: Switch.nodes.Application.Container.Docker\\n artifacts:\\n docker_image:\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n file: \"mogswitch/InputDistributor:1.0\"\\n repository: MOG_docker_hub\\n properties:\\n inPort: \\n type: integer\\n waitingTime:\\n type: integer\\n multicastAddrIP:\\n type: string\\n multicastAddrPort:\\n type: integer\\n videoWidth:\\n type: integer\\n videoHeight:\\n type: integer\\n\\n Switch.nodes.Application.Container.Docker.MOG.ProxyTranscoder:\\n derived_from: Switch.nodes.Application.Container.Docker \\n artifacts:\\n docker_image:\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n file: \"mogswitch/ProxyTranscoder:1.0\"\\n repository: MOG_docker_hub\\n properties:\\n multicastAddrIP: \\n type: string\\n multicastAddrPort:\\n type: integer\\n videoWidth:\\n type: integer\\n videoHeight:\\n type: integer\\n\\n Switch.nodes.Application.Connection:\\n derived_from: tosca.nodes.Root \\n properties:\\n source:\\n type: Switch.datatypes.Application.Connection.EndPoint\\n target:\\n type: Switch.datatypes.Application.Connection.EndPoint\\n bandwidth:\\n type: string\\n latency: \\n type: string\\n jitter: \\n type: string\\n multicast:\\n type: Switch.datatypes.Application.Connection.Multicast\\n\\n Switch.nodes.Compute:\\n derived_from: tosca.nodes.Compute\\n properties:\\n OStype:\\n type: string\\n nodetype:\\n type: string\\n domain:\\n type: string\\n public_address:\\n type: string\\n \n"
+
" ethernet_port:\\n type: list\\n entry_schema:\\n type: tosca.datatypes.network.NetworkInfo\\n script:\\n type: string\\n installation:\\n type: string\\n ssh_credential:\\n type: tosca.datatypes.Credential\\n\\n Switch.nodes.Network:\\n derived_from: tosca.nodes.network.Network\\n properties:\\n bandwidth:\\n type: string\\n latency:\\n type: string\\n jitter:\\n type: string\\n source:\\n type: Switch.datatypes.Network.EndPoint\\n target:\\n type: Switch.datatypes.Network.EndPoint\\n multicast:\\n type: Switch.datatypes.Network.Multicast\\n\\n\\ntopology_template:\\n \\n node_templates:\\n 2d13d708e3a9441ab8336ce874e08dd1:\\n type: Switch.nodes.Application.Container.Docker.MOG.InputDistributor\\n artifacts:\\n docker_image:\\n file: \"mogswitch/InputDistributor:1.0\"\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n repository: MOG_docker_hub\\n properties:\\n QoS:\\n response_time: 30ms\\n inPort: 2000\\n waitingTime: 5\\n multicastAddrIP: 255.2.2.0\\n multicastAddrPort: 3000\\n videoWidth: 176\\n videoHeight: 100\\n interfaces:\\n Standard:\\n create:\\n implementation: docker_image\\n inputs:\\n command: InputDistributor\\n exported_ports:\\n - 2000\\n port_bindings:\\n - \"2000:2000\"\\n - \"3000:3000\"\\n\\n 8fcc1788d9ee462c826572c79fdb2a6a:\\n type: Switch.nodes.Application.Container.Docker.MOG.ProxyTranscoder\\n artifacts:\\n docker_image:\\n file: \"mogswitch/ProxyTranscoder:1.0\"\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n repository: MOG_docker_hub\\n properties:\\n QoS:\\n response_time: 30ms\\n multicastAddrIP: 255.2.2.0\\n multicastAddrPort: 3000\\n videoWidth: 176\\n videoHeight: 100\\n interfaces:\\n Standard:\\n create:\\n implementation: docker_image\\n inputs:\\n command: ProxyTranscoder\\n exported_ports:\\n - 80\\n port_bindings:\\n - \"8080:80\"\\n\\n 5e0add703c8a43938a39301f572e46c0:\\n type: Switch.nodes.Application.Connection\\n properties:\\n source:\\n address: 192.168.21.11\\n component_name: 2d13d708e3a9441ab8336ce874e08dd1\\n netmask: 255.255.255.0\\n port_name: \"inputDistributor_out\"\\n target:\\n address: 192.168.21.12\\n component_name: 8fcc1788d9ee462c826572c79fdb2a6a\\n netmask: 255.255.255.0\\n port_name: \"proxyTranscoder_in\"\\n latency: 30ms\\n bandwidth: 130MB/s\\n jitter: 500ms\\n multicast:\\n multicastAddrIP: 255.2.2.0\\n multicastAddrPort: 3000\\n"
)
public
String
file
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v0/external/Register.java
deleted
100644 → 0
View file @
a9cb2403
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
data
.
v0
.
external
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
*
* @author S. Koulouzis
*/
@XmlRootElement
public
class
Register
{
/**
* The user name
*/
@DocumentationExample
(
"user"
)
public
String
user
;
/**
* The user password
*/
@DocumentationExample
(
"123abc"
)
public
String
pwd
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v0/external/Result.java
deleted
100644 → 0
View file @
a9cb2403
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
data
.
v0
.
external
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
*
* @author S. Koulouzis
*/
@XmlRootElement
public
class
Result
{
/**
* The status of the response
*/
@DocumentationExample
(
"Success"
)
public
String
status
;
/**
* Not used. Not used. It's there for backwards compatibility.
*/
@DocumentationExample
(
"INFO"
)
public
String
info
;
public
List
<
Attribute
>
file
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v0/external/Upload.java
deleted
100644 → 0
View file @
a9cb2403
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
data
.
v0
.
external
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
*
* @author S. Koulouzis
*/
@XmlRootElement
public
class
Upload
{
public
String
user
;
public
String
pwd
;
public
List
<
Attribute
>
file
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v1/external/PlanResponse.java
View file @
03b20b8c
...
@@ -32,11 +32,7 @@ public class PlanResponse extends KeyValueHolder {
...
@@ -32,11 +32,7 @@ public class PlanResponse extends KeyValueHolder {
private
String
toscaID
;
private
String
toscaID
;
private
String
name
;
// private Set<String> loweLevelPlansIDs;
private
Integer
level
;
private
Set
<
String
>
loweLevelPlansIDs
;
/**
/**
* The id of the TOSCA <code>PlaybookRepresentation</code> description from
* The id of the TOSCA <code>PlaybookRepresentation</code> description from
...
@@ -64,12 +60,12 @@ public class PlanResponse extends KeyValueHolder {
...
@@ -64,12 +60,12 @@ public class PlanResponse extends KeyValueHolder {
*
*
* @return the loweLevelPlansIDs
* @return the loweLevelPlansIDs
*/
*/
@DocumentationExample
(
"ew44Ae3946e0sdds4f562d84baA"
)
//
@DocumentationExample("ew44Ae3946e0sdds4f562d84baA")
public
Set
<
String
>
getLoweLevelPlanIDs
()
{
//
public Set<String> getLoweLevelPlanIDs() {
return
loweLevelPlansIDs
;
//
return loweLevelPlansIDs;
}
//
}
//
public
void
setLoweLevelPlansIDs
(
Set
<
String
>
loweLevelPlansIDs
)
{
//
public void setLoweLevelPlansIDs(Set<String> loweLevelPlansIDs) {
this
.
loweLevelPlansIDs
=
loweLevelPlansIDs
;
//
this.loweLevelPlansIDs = loweLevelPlansIDs;
}
//
}
}
}
drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/v1/Consumer.java
View file @
03b20b8c
...
@@ -45,7 +45,6 @@ import nl.uva.sne.drip.drip.provisioner.utils.MessageParsing;
...
@@ -45,7 +45,6 @@ import nl.uva.sne.drip.drip.provisioner.utils.MessageParsing;
import
nl.uva.sne.drip.drip.provisioner.utils.PropertyValues
;
import
nl.uva.sne.drip.drip.provisioner.utils.PropertyValues
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.io.FilenameUtils
;
//import org.globus.myproxy.MyProxyException;
import
org.ietf.jgss.GSSException
;
import
org.ietf.jgss.GSSException
;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
org.json.JSONException
;
...
@@ -130,7 +129,7 @@ public class Consumer extends DefaultConsumer {
...
@@ -130,7 +129,7 @@ public class Consumer extends DefaultConsumer {
+
ex
.
getClass
().
getName
()
+
"\",\"attributes\": null}]}"
;
+
ex
.
getClass
().
getName
()
+
"\",\"attributes\": null}]}"
;
}
}
}
finally
{
}
finally
{
logger
.
fine
(
"Sending Response: {0}"
+
response
);
logger
.
info
(
"Sending Response: {0}"
+
response
);
// Logger.getLogger(Consumer.class.getName()).log(Level.INFO, "Sending Response: {0}", response);
// Logger.getLogger(Consumer.class.getName()).log(Level.INFO, "Sending Response: {0}", response);
//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"
));
...
@@ -180,11 +179,6 @@ public class Consumer extends DefaultConsumer {
...
@@ -180,11 +179,6 @@ public class Consumer extends DefaultConsumer {
FileUtils
.
moveFile
(
topologyFile
,
mainTopologyFile
);
FileUtils
.
moveFile
(
topologyFile
,
mainTopologyFile
);
String
topTopologyLoadingPath
=
mainTopologyFile
.
getAbsolutePath
();
String
topTopologyLoadingPath
=
mainTopologyFile
.
getAbsolutePath
();
List
<
File
>
topologyFiles
=
MessageParsing
.
getTopologies
(
parameters
,
tempInputDirPath
,
1
);
List
<
File
>
topologyFiles
=
MessageParsing
.
getTopologies
(
parameters
,
tempInputDirPath
,
1
);
// for (File lowLevelTopologyFile : topologyFiles) {
// File secondaryTopologyFile = new File(tempInputDirPath + File.separator + lowLevelTopologyFile.getName() + ".yml");
// FileUtils.moveFile(lowLevelTopologyFile, secondaryTopologyFile);
// }
// Logger.getLogger(Consumer.class.getName()).log(Level.INFO, "Saved topology file");
logger
.
info
(
"Saved topology file"
);
logger
.
info
(
"Saved topology file"
);
Map
<
String
,
Object
>
map
=
Converter
.
ymlStream2Map
(
new
FileInputStream
(
topTopologyLoadingPath
));
Map
<
String
,
Object
>
map
=
Converter
.
ymlStream2Map
(
new
FileInputStream
(
topTopologyLoadingPath
));
String
userPublicKeyName
=
((
String
)
map
.
get
(
"publicKeyPath"
));
String
userPublicKeyName
=
((
String
)
map
.
get
(
"publicKeyPath"
));
...
...
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