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
6b86c1a2
Commit
6b86c1a2
authored
Mar 17, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added MissingVMTopologyException
parent
2a282261
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
263 additions
and
253 deletions
+263
-253
.travis.yml
.travis.yml
+1
-1
DRIPService.java
...er/src/main/java/nl/uva/sne/drip/service/DRIPService.java
+12
-6
ServiceTests.java
...r/src/test/java/nl/uva/sne/drip/service/ServiceTests.java
+245
-243
tosca_template_service.py
...flask-server/sure_tosca/service/tosca_template_service.py
+5
-3
No files found.
.travis.yml
View file @
6b86c1a2
...
...
@@ -12,7 +12,7 @@ matrix:
-
python -m unittest discover
-
docker build -t alogo53/planner:3.0.0 .
-
language
:
python
python
:
3.
8
python
:
3.
7
before_script
:
-
cd sure_tosca-flask-server
-
pip install -r requirements.txt
...
...
manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java
View file @
6b86c1a2
...
...
@@ -16,6 +16,7 @@ import java.util.logging.Logger;
import
nl.uva.sne.drip.api.NotFoundException
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.model.Exceptions.MissingCredentialsException
;
import
nl.uva.sne.drip.model.Exceptions.MissingVMTopologyException
;
import
nl.uva.sne.drip.model.Exceptions.TypeExeption
;
import
nl.uva.sne.drip.model.Message
;
import
nl.uva.sne.drip.model.NodeTemplateMap
;
...
...
@@ -94,8 +95,11 @@ public class DRIPService {
return
credentials
.
get
(
0
);
}
private
ToscaTemplate
addCredentials
(
ToscaTemplate
toscaTemplate
)
throws
MissingCredentialsException
,
ApiException
,
TypeExeption
{
private
ToscaTemplate
addCredentials
(
ToscaTemplate
toscaTemplate
)
throws
MissingCredentialsException
,
ApiException
,
TypeExeption
,
MissingVMTopologyException
{
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
if
(
vmTopologies
==
null
){
throw
new
MissingVMTopologyException
(
"ToscaTemplate: "
+
toscaTemplate
+
" has no VM topology"
);
}
List
<
Credential
>
credentials
=
null
;
for
(
NodeTemplateMap
vmTopologyMap
:
vmTopologies
)
{
String
provider
=
helper
.
getTopologyProvider
(
vmTopologyMap
);
...
...
@@ -120,7 +124,7 @@ public class DRIPService {
return
execute
(
toscaTemplate
);
}
public
String
provision
(
String
id
)
throws
MissingCredentialsException
,
ApiException
,
TypeExeption
,
IOException
,
JsonProcessingException
,
TimeoutException
,
InterruptedException
,
NotFoundException
{
public
String
provision
(
String
id
)
throws
MissingCredentialsException
,
ApiException
,
TypeExeption
,
IOException
,
JsonProcessingException
,
TimeoutException
,
InterruptedException
,
NotFoundException
,
MissingVMTopologyException
{
ToscaTemplate
toscaTemplate
=
initExecution
(
id
);
toscaTemplate
=
addCredentials
(
toscaTemplate
);
toscaTemplate
=
setProvisionerOperation
(
toscaTemplate
,
PROVISIONER_OPERATION
.
PROVISION
);
...
...
@@ -169,12 +173,14 @@ public class DRIPService {
void
deleteActions
(
ToscaTemplate
toscaTemplate
)
throws
ApiException
,
TypeExeption
,
IOException
{
helper
.
uploadToscaTemplate
(
toscaTemplate
);
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
for
(
NodeTemplateMap
vmTopology
:
vmTopologies
)
{
CloudsStormSubTopology
.
StatusEnum
status
=
helper
.
getVMTopologyTemplateStatus
(
vmTopology
);
if
(!
status
.
equals
(
CloudsStormSubTopology
.
StatusEnum
.
DELETED
))
{
if
(
vmTopologies
!=
null
)
{
for
(
NodeTemplateMap
vmTopology
:
vmTopologies
)
{
CloudsStormSubTopology
.
StatusEnum
status
=
helper
.
getVMTopologyTemplateStatus
(
vmTopology
);
if
(!
status
.
equals
(
CloudsStormSubTopology
.
StatusEnum
.
DELETED
))
{
Logger
.
getLogger
(
ToscaHelper
.
class
.
getName
()).
log
(
Level
.
FINE
,
"Deleting VMs from "
+
vmTopology
);
}
}
}
}
...
...
manager/src/test/java/nl/uva/sne/drip/service/ServiceTests.java
View file @
6b86c1a2
This diff is collapsed.
Click to expand it.
sure_tosca-flask-server/sure_tosca/service/tosca_template_service.py
View file @
6b86c1a2
...
...
@@ -221,9 +221,11 @@ def get_node_templates(id, type_name=None, node_name=None, has_interfaces=None,
prop
=
None
queries
.
append
(
query
.
artifacts
!=
prop
)
query_results
=
query_db
(
queries
,
db
=
node_template_db
)
return
change_to_node_template_model
(
query_results
)
if
query_results
:
return
change_to_node_template_model
(
query_results
)
else
:
return
query_results
def
get_tosca_template_get_dsl_definitions
(
id
,
anchors
,
derived_from
):
...
...
@@ -479,4 +481,4 @@ def get_default_interface(id, interface_type, instance_name, operation_name):
instance_inputs
=
{
'inputs'
:
instance_inputs_list
}
operation
=
{
operation_name
:
instance_inputs
}
instance
=
{
instance_name
:
operation
}
return
instance
\ No newline at end of file
return
instance
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