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
7902a445
Commit
7902a445
authored
Sep 10, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added username property
parent
d81db714
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
68 additions
and
691 deletions
+68
-691
application_example.yaml
TOSCA/application_example.yaml
+6
-3
application_example_output.yaml
TOSCA/application_example_output.yaml
+24
-26
nodes.yaml
TOSCA/types/nodes.yaml
+3
-0
DRIPCaller.java
...api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java
+2
-2
PlannerService.java
...main/java/nl/uva/sne/drip/api/service/PlannerService.java
+20
-29
PlannerController.java
...in/java/nl/uva/sne/drip/controller/PlannerController.java
+0
-42
ProvisionController.java
.../java/nl/uva/sne/drip/controller/ProvisionController.java
+0
-41
CloudStormService.java
.../main/java/nl/uva/sne/drip/service/CloudStormService.java
+0
-64
PlannerService.java
...src/main/java/nl/uva/sne/drip/service/PlannerService.java
+0
-31
Artifact.java
...va/nl/uva/sne/drip/drip/commons/model/tosca/Artifact.java
+0
-24
Attribute.java
...a/nl/uva/sne/drip/drip/commons/model/tosca/Attribute.java
+0
-24
Constraint.java
.../nl/uva/sne/drip/drip/commons/model/tosca/Constraint.java
+0
-33
EntrySchema.java
...nl/uva/sne/drip/drip/commons/model/tosca/EntrySchema.java
+0
-32
Interface.java
...a/nl/uva/sne/drip/drip/commons/model/tosca/Interface.java
+0
-24
Property.java
...va/nl/uva/sne/drip/drip/commons/model/tosca/Property.java
+0
-50
PropertyStatus.java
...uva/sne/drip/drip/commons/model/tosca/PropertyStatus.java
+0
-28
Requirement.java
...nl/uva/sne/drip/drip/commons/model/tosca/Requirement.java
+0
-24
Capabilities.java
...p/drip/commons/model/tosca/capabilities/Capabilities.java
+0
-40
NodeState.java
...va/sne/drip/drip/commons/model/tosca/nodes/NodeState.java
+0
-24
RootNode.java
...uva/sne/drip/drip/commons/model/tosca/nodes/RootNode.java
+0
-145
workspace.xml
drip_planner2/.idea/workspace.xml
+11
-5
basic_planner.py
drip_planner2/src/planner/basic_planner.py
+2
-0
No files found.
TOSCA/application_example.yaml
View file @
7902a445
tosca_definitions_version
:
tosca_simple_yaml_1_0
tosca_definitions_version
:
tosca_simple_yaml_1_0
imports
:
imports
:
-
nodes
:
types/nodes.yaml
-
nodes
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml
-
capabilities
:
types/capabilities.yaml
-
capabilities
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml
-
policies
:
types/policies.yaml
-
policies
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml
repositories
:
docker_hub
:
https://hub.docker.com/
description
:
>
description
:
>
TOSCA example
TOSCA example
...
...
TOSCA/application_example_output.yaml
View file @
7902a445
tosca_definitions_version
:
tosca_simple_yaml_1_0
tosca_definitions_version
:
tosca_simple_yaml_1_0
repositories
:
docker_hub
:
https://hub.docker.com/
imports
:
imports
:
-
nodes
:
types/nodes.yaml
-
nodes
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml
-
capabilities
:
types/capabilities.yaml
-
capabilities
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml
-
policies
:
types/policies.yaml
-
policies
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml
description
:
>
TOSCA example
topology_template
:
topology_template
:
node_templates
:
node_templates
:
erica
_topology
:
beverly
_topology
:
interfaces
:
interfaces
:
Standard
:
Standard
:
create
:
dumy.yaml
create
:
dumy.yaml
...
@@ -22,38 +20,38 @@ topology_template:
...
@@ -22,38 +20,38 @@ topology_template:
requirements
:
requirements
:
-
vm
:
-
vm
:
capability
:
tosca.capabilities.ARTICONF.VM
capability
:
tosca.capabilities.ARTICONF.VM
node
:
james
_compute
node
:
nancy
_compute
relationship
:
tosca.relationships.DependsOn
relationship
:
tosca.relationships.DependsOn
-
vm
:
-
vm
:
capability
:
tosca.capabilities.ARTICONF.VM
capability
:
tosca.capabilities.ARTICONF.VM
node
:
james
_compute
node
:
nancy
_compute
relationship
:
tosca.relationships.DependsOn
relationship
:
tosca.relationships.DependsOn
type
:
tosca.nodes.ARTICONF.VM.topology
type
:
tosca.nodes.ARTICONF.VM.topology
heather_kubernetes
:
charles_compute
:
interfaces
:
Standard
:
create
:
dumy.yaml
properties
:
cpu_frequency
:
2.9 GHz
disk_size
:
25000 MB
host_name
:
vm
mem_size
:
3000 MB
num_cpus
:
1
type
:
tosca.nodes.ARTICONF.VM.Compute
heidi_kubernetes
:
interfaces
:
interfaces
:
Standard
:
Standard
:
create
:
interfaces/playbooks/kubernetes_install.yaml
create
:
interfaces/playbooks/kubernetes_install.yaml
requirements
:
requirements
:
-
host
:
-
host
:
capability
:
tosca.capabilities.Scalable
capability
:
tosca.capabilities.Scalable
node
:
erica
_topology
node
:
beverly
_topology
relationship
:
tosca.relationships.HostedOn
relationship
:
tosca.relationships.HostedOn
-
host
:
-
host
:
capability
:
tosca.capabilities.Compute
capability
:
tosca.capabilities.Compute
node
:
erica
_topology
node
:
beverly
_topology
relationship
:
tosca.relationships.HostedOn
relationship
:
tosca.relationships.HostedOn
type
:
tosca.nodes.ARTICONF.Orchestrator.Kubernetes
type
:
tosca.nodes.ARTICONF.Orchestrator.Kubernetes
james_compute
:
interfaces
:
Standard
:
create
:
dumy.yaml
properties
:
cpu_frequency
:
2.9 GHz
disk_size
:
25000 MB
host_name
:
vm
mem_size
:
3000 MB
num_cpus
:
1
type
:
tosca.nodes.ARTICONF.VM.Compute
mysql
:
mysql
:
artifacts
:
artifacts
:
image
:
image
:
...
@@ -71,10 +69,10 @@ topology_template:
...
@@ -71,10 +69,10 @@ topology_template:
requirements
:
requirements
:
-
host
:
-
host
:
capability
:
tosca.capabilities.ARTICONF.Orchestrator
capability
:
tosca.capabilities.ARTICONF.Orchestrator
node
:
he
ather
_kubernetes
node
:
he
idi
_kubernetes
relationship
:
tosca.relationships.HostedOn
relationship
:
tosca.relationships.HostedOn
type
:
tosca.nodes.ARTICONF.Container.Application.Docker
type
:
tosca.nodes.ARTICONF.Container.Application.Docker
shenita
_compute
:
nancy
_compute
:
interfaces
:
interfaces
:
Standard
:
Standard
:
create
:
dumy.yaml
create
:
dumy.yaml
...
...
TOSCA/types/nodes.yaml
View file @
7902a445
...
@@ -77,6 +77,9 @@ node_types:
...
@@ -77,6 +77,9 @@ node_types:
compute
:
compute
:
type
:
tosca.capabilities.ARTICONF.VM
type
:
tosca.capabilities.ARTICONF.VM
properties
:
properties
:
user_name
:
type
:
string
required
:
true
host_name
:
host_name
:
type
:
string
type
:
string
required
:
true
required
:
true
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java
View file @
7902a445
...
@@ -103,7 +103,7 @@ public abstract class DRIPCaller implements AutoCloseable {
...
@@ -103,7 +103,7 @@ public abstract class DRIPCaller implements AutoCloseable {
.
correlationId
(
corrId
)
.
correlationId
(
corrId
)
.
replyTo
(
getReplyQueueName
())
.
replyTo
(
getReplyQueueName
())
.
build
();
.
build
();
Logger
.
getLogger
(
DRIPCaller
.
class
.
getName
()).
log
(
Level
.
INFO
,
"Sending:
{0}"
,
jsonInString
);
Logger
.
getLogger
(
DRIPCaller
.
class
.
getName
()).
log
(
Level
.
INFO
,
"Sending:
"
+
jsonInString
+
" to queue: "
+
requestQeueName
);
getChannel
().
basicPublish
(
""
,
requestQeueName
,
props
,
jsonInString
.
getBytes
(
"UTF-8"
));
getChannel
().
basicPublish
(
""
,
requestQeueName
,
props
,
jsonInString
.
getBytes
(
"UTF-8"
));
final
BlockingQueue
<
String
>
response
=
new
ArrayBlockingQueue
(
1
);
final
BlockingQueue
<
String
>
response
=
new
ArrayBlockingQueue
(
1
);
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/PlannerService.java
View file @
7902a445
...
@@ -89,42 +89,33 @@ public class PlannerService {
...
@@ -89,42 +89,33 @@ public class PlannerService {
ObjectMapper
mapper
=
new
ObjectMapper
();
ObjectMapper
mapper
=
new
ObjectMapper
();
mapper
.
configure
(
JsonParser
.
Feature
.
ALLOW_SINGLE_QUOTES
,
true
);
mapper
.
configure
(
JsonParser
.
Feature
.
ALLOW_SINGLE_QUOTES
,
true
);
List
<
MessageParameter
>
messageParams
=
plannerReturnedMessage
.
getParameters
();
List
<
MessageParameter
>
messageParams
=
plannerReturnedMessage
.
getParameters
();
StringBuilder
jsonArrayString
=
new
StringBuilder
();
jsonArrayString
.
append
(
"["
);
String
prefix
=
""
;
for
(
MessageParameter
mp
:
messageParams
)
{
for
(
MessageParameter
mp
:
messageParams
)
{
String
value
=
mp
.
getValue
();
String
value
=
mp
.
getValue
();
jsonArrayString
.
append
(
prefix
);
logger
.
log
(
Level
.
INFO
,
"value: "
+
value
);
prefix
=
","
;
String
jsonValue
=
value
.
replaceAll
(
"\\\""
,
"\""
);
jsonArrayString
.
append
(
jsonValue
);
}
jsonArrayString
.
append
(
"]"
);
if
(
cloudProvider
==
null
)
{
cloudProvider
=
getBestCloudProvider
();
}
}
String
domainName
=
getBestDomain
(
cloudProvider
);
String
domainName
=
getBestDomain
(
cloudProvider
);
SimplePlanContainer
simplePlan
=
P2PConverter
.
transfer
(
jsonArrayString
.
toString
(),
"vm_user"
,
domainName
,
cloudProvider
);
//
SimplePlanContainer simplePlan = P2PConverter.transfer(jsonArrayString.toString(), "vm_user", domainName, cloudProvider);
PlanResponse
topLevel
=
new
PlanResponse
();
PlanResponse
topLevel
=
new
PlanResponse
();
topLevel
.
setLevel
(
0
);
//
topLevel.setLevel(0);
topLevel
.
setToscaID
(
toscaId
);
//
topLevel.setToscaID(toscaId);
topLevel
.
setName
(
"planner_output_all.yml"
);
//
topLevel.setName("planner_output_all.yml");
topLevel
.
setKvMap
(
Converter
.
ymlString2Map
(
simplePlan
.
topLevelContents
));
//
topLevel.setKvMap(Converter.ymlString2Map(simplePlan.topLevelContents));
Map
<
String
,
String
>
map
=
simplePlan
.
lowerLevelContents
;
//
Map<String, String> map = simplePlan.lowerLevelContents;
Set
<
String
>
loweLevelPlansIDs
=
new
HashSet
<>();
//
Set<String> loweLevelPlansIDs = new HashSet<>();
for
(
String
lowLevelNames
:
map
.
keySet
())
{
//
for (String lowLevelNames : map.keySet()) {
PlanResponse
lowLevelPlan
=
new
PlanResponse
();
//
PlanResponse lowLevelPlan = new PlanResponse();
lowLevelPlan
.
setLevel
(
1
);
//
lowLevelPlan.setLevel(1);
lowLevelPlan
.
setToscaID
(
toscaId
);
//
lowLevelPlan.setToscaID(toscaId);
lowLevelPlan
.
setName
(
lowLevelNames
);
//
lowLevelPlan.setName(lowLevelNames);
lowLevelPlan
.
setKvMap
(
Converter
.
ymlString2Map
(
map
.
get
(
lowLevelNames
)));
//
lowLevelPlan.setKvMap(Converter.ymlString2Map(map.get(lowLevelNames)));
save
(
lowLevelPlan
);
//
save(lowLevelPlan);
loweLevelPlansIDs
.
add
(
lowLevelPlan
.
getId
());
//
loweLevelPlansIDs.add(lowLevelPlan.getId());
}
//
}
//
topLevel
.
setLoweLevelPlansIDs
(
loweLevelPlansIDs
);
//
topLevel.setLoweLevelPlansIDs(loweLevelPlansIDs);
save
(
topLevel
);
save
(
topLevel
);
logger
.
log
(
Level
.
INFO
,
"Plan saved"
);
logger
.
log
(
Level
.
INFO
,
"Plan saved"
);
return
topLevel
;
return
topLevel
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/controller/PlannerController.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.webcohesion.enunciate.metadata.rs.ResponseCode
;
import
com.webcohesion.enunciate.metadata.rs.StatusCodes
;
import
nl.uva.sne.drip.service.CloudStormService
;
import
nl.uva.sne.drip.service.PlannerService
;
import
org.springframework.beans.factory.annotation.Autowired
;
/**
* This controller is responsible for obtaining resources from cloud providers
*
*
* @author S. Koulouzis
*/
@RestController
@RequestMapping
(
"/user/v3.0/planner"
)
@StatusCodes
({
@ResponseCode
(
code
=
401
,
condition
=
"Bad credentials"
)
})
public
class
PlannerController
{
@Autowired
private
PlannerService
plannerService
;
}
drip-api/src/main/java/nl/uva/sne/drip/controller/ProvisionController.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.webcohesion.enunciate.metadata.rs.ResponseCode
;
import
com.webcohesion.enunciate.metadata.rs.StatusCodes
;
import
nl.uva.sne.drip.service.CloudStormService
;
import
org.springframework.beans.factory.annotation.Autowired
;
/**
* This controller is responsible for obtaining resources from cloud providers
*
*
* @author S. Koulouzis
*/
@RestController
@RequestMapping
(
"/user/v3.0/provisioner"
)
@StatusCodes
({
@ResponseCode
(
code
=
401
,
condition
=
"Bad credentials"
)
})
public
class
ProvisionController
{
@Autowired
private
CloudStormService
provisionService
;
}
drip-api/src/main/java/nl/uva/sne/drip/service/CloudStormService.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
service
;
import
lambdaInfrs.engine.TEngine.TEngine
;
import
nl.uva.sne.drip.drip.commons.model.InfrastructureDescription
;
import
org.springframework.amqp.rabbit.connection.CachingConnectionFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
topology.analysis.TopologyAnalysisMain
;
/**
*
* @author S. Koulouzis
*/
@Service
public
class
CloudStormService
{
@Value
(
"${provisioner.queue.prefix}"
)
private
String
provisionerQueuePrefix
;
public
InfrastructureDescription
provision
(
InfrastructureDescription
description
)
{
return
null
;
}
public
InfrastructureDescription
start
()
{
return
null
;
}
public
InfrastructureDescription
stop
()
{
return
null
;
}
public
InfrastructureDescription
delete
()
{
return
null
;
}
public
InfrastructureDescription
recover
()
{
return
null
;
}
public
InfrastructureDescription
detectFailure
()
{
return
null
;
}
public
InfrastructureDescription
scale
()
{
return
null
;
}
}
drip-api/src/main/java/nl/uva/sne/drip/service/PlannerService.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
service
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
/**
*
* @author S. Koulouzis
*/
@Service
public
class
PlannerService
{
@Value
(
"${planner.queue.prefix}"
)
private
String
plannerQueuePrefix
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/Artifact.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
model
.
tosca
;
/**
*
* @author S. Koulouzis
*/
public
class
Artifact
{
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/Attribute.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
model
.
tosca
;
/**
*
* @author S. Koulouzis
*/
public
abstract
class
Attribute
{
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/Constraint.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
model
.
tosca
;
/**
*
* @author S. Koulouzis
*/
public
enum
Constraint
{
EQUAL
,
GREATERTHAN
,
GREATEROREQUAL
,
LESSTHAN
,
INRANGE
,
VALIDVALUES
,
LENGTH
,
MINLENGTH
,
MAXLENGTH
,
PATTERN
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/EntrySchema.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
model
.
tosca
;
import
java.util.List
;
/**
*
* @author S. Koulouzis
*/
public
abstract
class
EntrySchema
{
@org
.
neo4j
.
ogm
.
annotation
.
Property
(
name
=
"type"
)
private
String
type
;
@org
.
neo4j
.
ogm
.
annotation
.
Property
(
name
=
"description"
)
private
String
description
;
@org
.
neo4j
.
ogm
.
annotation
.
Property
(
name
=
"constraints"
)
private
List
<
Constraint
>
constraints
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/Interface.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
model
.
tosca
;
/**
*
* @author S. Koulouzis
*/
public
abstract
class
Interface
{
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/Property.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
model
.
tosca
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.namespace.QName
;
/**
*
* @author S. Koulouzis
*/
public
abstract
class
Property
{
@org
.
neo4j
.
ogm
.
annotation
.
Property
(
name
=
"type"
)
private
String
type
;
@org
.
neo4j
.
ogm
.
annotation
.
Property
(
name
=
"description"
)
private
String
description
;
@org
.
neo4j
.
ogm
.
annotation
.
Property
(
name
=
"required"
)
private
Boolean
required
;
@org
.
neo4j
.
ogm
.
annotation
.
Property
(
name
=
"default"
)
private
Object
defaultValue
;
@org
.
neo4j
.
ogm
.
annotation
.
Property
(
name
=
"status"
)
private
PropertyStatus
status
;
@org
.
neo4j
.
ogm
.
annotation
.
Property
(
name
=
"constraints"
)
private
List
<
Constraint
>
constraints
;
@org
.
neo4j
.
ogm
.
annotation
.
Property
(
name
=
"entry_schema"
)
private
EntrySchema
entrySchema
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/PropertyStatus.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
model
.
tosca
;
/**
*
* @author S. Koulouzis
*/
public
enum
PropertyStatus
{
SUPPORTED
,
UNSUPPORTED
,
EXPERIMENTAL
,
DEPRECTED
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/Requirement.java
deleted
100644 → 0
View file @
d81db714
/*
* Copyright 2019 S. Koulouzis, 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
.
model
.
tosca
;
/**
*
* @author S. Koulouzis
*/
public
abstract
class
Requirement
{
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/capabilities/Capabilities.java
deleted
100644 → 0
View file @
d81db714
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
model
.
tosca
.
capabilities
;
import
java.util.List
;
import
java.util.Map
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.namespace.QName
;
import
nl.uva.sne.drip.drip.commons.model.tosca.Attribute
;
import
org.neo4j.ogm.annotation.Properties
;
import
org.neo4j.ogm.annotation.Property
;
/**
* http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/os/TOSCA-Simple-Profile-YAML-v1.0-os.html#DEFN_TYPE_CAPABILITIES_ROOT
*
* @author alogo
*/
public
abstract
class
Capabilities
{
@Property
(
name
=
"type"
)
private
String
type
;
@Property
(
name
=
"description"
)
private
String
description
;
@Property
(
name
=
"valid_source_types"
)
private
List
<
String
>
validSourceTypes
;
@Property
(
name
=
"occurrences"
)
private
List
<
String
>
occurrences
;
@Properties
private
Map
<
String
,
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
model
.
tosca
.
Property
>
properties
;
@Properties
private
Map
<
String
,
Attribute
>
attributes
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/nodes/NodeState.java
deleted
100644 → 0
View file @
d81db714
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
model
.
tosca
.
nodes
;
/**
*
* @author S. Koulouzis
*/
//http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/os/TOSCA-Simple-Profile-YAML-v1.0-os.html#DEFN_TOSCA_VALUES_STATE
public
enum
NodeState
{
INITIAL
,
CREATING
,
CREATED
,
CONFIGURING
,
CONFIGURED
,
STARTING
,
STARTED
,
STOPPING
,
DELETING
,
ERROR
;
}
drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/nodes/RootNode.java
deleted
100644 → 0
View file @
d81db714
package
nl
.
uva
.
sne
.
drip
.
drip
.
commons
.
model
.
tosca
.
nodes
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
nl.uva.sne.drip.drip.commons.model.tosca.Artifact
;
import
nl.uva.sne.drip.drip.commons.model.tosca.Attribute
;
import
nl.uva.sne.drip.drip.commons.model.tosca.Interface
;
import
nl.uva.sne.drip.drip.commons.model.tosca.Requirement
;
import
nl.uva.sne.drip.drip.commons.model.tosca.capabilities.Capabilities
;
import
org.neo4j.ogm.annotation.GeneratedValue
;
import
org.neo4j.ogm.annotation.Id
;
import
org.neo4j.ogm.annotation.NodeEntity
;
import
org.neo4j.ogm.annotation.Properties
;
import
org.neo4j.ogm.annotation.Property
;
/**
*
* @author S. Koulouzis
*/
@NodeEntity
public
abstract
class
RootNode
{
@Id
@GeneratedValue
private
Long
tosca_id
;
@Property
(
name
=
"tosca_name"
)
private
String
tosca_name
;
@Property
(
name
=
"state"
)
private
NodeState
state
;
@Properties
private
Map
<
String
,
Capabilities
>
capabilities
;
@Properties
private
Map
<
String
,
Attribute
>
attributes
;
@Properties
private
List
<
Requirement
>
requirements
;
@Properties
private
Map
<
String
,
Interface
>
interfaces
;
@Properties
private
Map
<
String
,
Artifact
>
artifacts
;
/**
* @return the tosca_name
*/
public
String
getTosca_name
()
{
return
tosca_name
;
}
/**
* @param tosca_name the tosca_name to set
*/
public
void
setTosca_name
(
String
tosca_name
)
{
this
.
tosca_name
=
tosca_name
;
}
/**
* @return the state
*/
public
NodeState
getState
()
{
return
state
;
}
/**
* @param state the state to set
*/
public
void
setState
(
NodeState
state
)
{
this
.
state
=
state
;
}
/**
* @return the capabilities
*/
public
Map
<
String
,
Capabilities
>
getCapabilities
()
{
return
capabilities
;
}
/**
* @param capabilities the capabilities to set
*/
public
void
setCapabilities
(
Map
<
String
,
Capabilities
>
capabilities
)
{
this
.
capabilities
=
capabilities
;
}
/**
* @return the attributes
*/
public
Map
<
String
,
Attribute
>
getAttributes
()
{
return
attributes
;
}
/**
* @param attributes the attributes to set
*/
public
void
setAttributes
(
Map
<
String
,
Attribute
>
attributes
)
{
this
.
attributes
=
attributes
;
}
/**
* @return the requirements
*/
public
List
<
Requirement
>
getRequirements
()
{
return
requirements
;
}
/**
* @param requirements the requirements to set
*/
public
void
setRequirements
(
List
<
Requirement
>
requirements
)
{
this
.
requirements
=
requirements
;
}
/**
* @return the interfaces
*/
public
Map
<
String
,
Interface
>
getInterfaces
()
{
return
interfaces
;
}
/**
* @param interfaces the interfaces to set
*/
public
void
setInterfaces
(
Map
<
String
,
Interface
>
interfaces
)
{
this
.
interfaces
=
interfaces
;
}
/**
* @return the artifacts
*/
public
Map
<
String
,
Artifact
>
getArtifacts
()
{
return
artifacts
;
}
/**
* @param artifacts the artifacts to set
*/
public
void
setArtifacts
(
Map
<
String
,
Artifact
>
artifacts
)
{
this
.
artifacts
=
artifacts
;
}
}
drip_planner2/.idea/workspace.xml
View file @
7902a445
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"462ede19-adfe-472b-975e-fefefa973fe0"
name=
"Default Changelist"
comment=
"slolved cap error"
>
<list
default=
"true"
id=
"462ede19-adfe-472b-975e-fefefa973fe0"
name=
"Default Changelist"
comment=
"slolved cap error"
>
<change
beforePath=
"$PROJECT_DIR$/../TOSCA/application_example.yaml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../TOSCA/application_example.yaml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../TOSCA/application_example.yaml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../TOSCA/application_example.yaml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../TOSCA/application_example_output.yaml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../TOSCA/application_example_output.yaml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/controller/PlannerController.java"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/controller/PlannerController.java"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/controller/ProvisionController.java"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/controller/ProvisionController.java"
beforeDir=
"false"
/>
...
@@ -19,9 +20,6 @@
...
@@ -19,9 +20,6 @@
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/capabilities/Capabilities.java"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/capabilities/Capabilities.java"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/nodes/NodeState.java"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/nodes/NodeState.java"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/nodes/RootNode.java"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/nodes/RootNode.java"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/planner/basic_planner.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/planner/basic_planner.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/rpc_server.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/rpc_server.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/venv/lib/python3.6/site-packages/easy-install.pth"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/venv/lib/python3.6/site-packages/easy-install.pth"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/venv/lib/python3.6/site-packages/prettytable.py"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/venv/lib/python3.6/site-packages/prettytable.py"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/venv/lib/python3.6/site-packages/pyparsing.py"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/venv/lib/python3.6/site-packages/pyparsing.py"
beforeDir=
"false"
/>
...
@@ -134,7 +132,14 @@
...
@@ -134,7 +132,14 @@
<option
name=
"project"
value=
"LOCAL"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1568115528728
</updated>
<updated>
1568115528728
</updated>
</task>
</task>
<option
name=
"localTasksCounter"
value=
"2"
/>
<task
id=
"LOCAL-00002"
summary=
"format TOSCA output"
>
<created>
1568123822036
</created>
<option
name=
"number"
value=
"00002"
/>
<option
name=
"presentableId"
value=
"LOCAL-00002"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1568123822036
</updated>
</task>
<option
name=
"localTasksCounter"
value=
"3"
/>
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"Vcs.Log.Tabs.Properties"
>
<component
name=
"Vcs.Log.Tabs.Properties"
>
...
@@ -153,7 +158,8 @@
...
@@ -153,7 +158,8 @@
<component
name=
"VcsManagerConfiguration"
>
<component
name=
"VcsManagerConfiguration"
>
<MESSAGE
value=
"slolved cap error"
/>
<MESSAGE
value=
"slolved cap error"
/>
<MESSAGE
value=
"produces valid TOSCA"
/>
<MESSAGE
value=
"produces valid TOSCA"
/>
<option
name=
"LAST_COMMIT_MESSAGE"
value=
"produces valid TOSCA"
/>
<MESSAGE
value=
"format TOSCA output"
/>
<option
name=
"LAST_COMMIT_MESSAGE"
value=
"format TOSCA output"
/>
</component>
</component>
<component
name=
"XDebuggerManager"
>
<component
name=
"XDebuggerManager"
>
<breakpoint-manager>
<breakpoint-manager>
...
...
drip_planner2/src/planner/basic_planner.py
View file @
7902a445
...
@@ -46,6 +46,8 @@ def set_VM_properties(node_template_dict):
...
@@ -46,6 +46,8 @@ def set_VM_properties(node_template_dict):
node_template_dict
[
'properties'
]
.
pop
(
'disk_size'
)
node_template_dict
[
'properties'
]
.
pop
(
'disk_size'
)
node_template_dict
[
'properties'
][
'disk_size'
]
=
get_disk_size
()
node_template_dict
[
'properties'
][
'disk_size'
]
=
get_disk_size
()
node_template_dict
[
'properties'
][
'mem_size'
]
=
get_mem_size
()
node_template_dict
[
'properties'
][
'mem_size'
]
=
get_mem_size
()
node_template_dict
[
'properties'
]
.
pop
(
'user_name'
)
node_template_dict
[
'properties'
][
'user_name'
]
=
'vm_user'
return
node_template_dict
return
node_template_dict
def
set_topology_properties
(
node_template_dict
):
def
set_topology_properties
(
node_template_dict
):
...
...
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