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
Show 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:
...
@@ -12,7 +12,7 @@ matrix:
-
python -m unittest discover
-
python -m unittest discover
-
docker build -t alogo53/planner:3.0.0 .
-
docker build -t alogo53/planner:3.0.0 .
-
language
:
python
-
language
:
python
python
:
3.
8
python
:
3.
7
before_script
:
before_script
:
-
cd sure_tosca-flask-server
-
cd sure_tosca-flask-server
-
pip install -r requirements.txt
-
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;
...
@@ -16,6 +16,7 @@ import java.util.logging.Logger;
import
nl.uva.sne.drip.api.NotFoundException
;
import
nl.uva.sne.drip.api.NotFoundException
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.model.Exceptions.MissingCredentialsException
;
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.Exceptions.TypeExeption
;
import
nl.uva.sne.drip.model.Message
;
import
nl.uva.sne.drip.model.Message
;
import
nl.uva.sne.drip.model.NodeTemplateMap
;
import
nl.uva.sne.drip.model.NodeTemplateMap
;
...
@@ -94,8 +95,11 @@ public class DRIPService {
...
@@ -94,8 +95,11 @@ public class DRIPService {
return
credentials
.
get
(
0
);
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
();
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
if
(
vmTopologies
==
null
){
throw
new
MissingVMTopologyException
(
"ToscaTemplate: "
+
toscaTemplate
+
" has no VM topology"
);
}
List
<
Credential
>
credentials
=
null
;
List
<
Credential
>
credentials
=
null
;
for
(
NodeTemplateMap
vmTopologyMap
:
vmTopologies
)
{
for
(
NodeTemplateMap
vmTopologyMap
:
vmTopologies
)
{
String
provider
=
helper
.
getTopologyProvider
(
vmTopologyMap
);
String
provider
=
helper
.
getTopologyProvider
(
vmTopologyMap
);
...
@@ -120,7 +124,7 @@ public class DRIPService {
...
@@ -120,7 +124,7 @@ public class DRIPService {
return
execute
(
toscaTemplate
);
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
toscaTemplate
=
initExecution
(
id
);
toscaTemplate
=
addCredentials
(
toscaTemplate
);
toscaTemplate
=
addCredentials
(
toscaTemplate
);
toscaTemplate
=
setProvisionerOperation
(
toscaTemplate
,
PROVISIONER_OPERATION
.
PROVISION
);
toscaTemplate
=
setProvisionerOperation
(
toscaTemplate
,
PROVISIONER_OPERATION
.
PROVISION
);
...
@@ -169,13 +173,15 @@ public class DRIPService {
...
@@ -169,13 +173,15 @@ public class DRIPService {
void
deleteActions
(
ToscaTemplate
toscaTemplate
)
throws
ApiException
,
TypeExeption
,
IOException
{
void
deleteActions
(
ToscaTemplate
toscaTemplate
)
throws
ApiException
,
TypeExeption
,
IOException
{
helper
.
uploadToscaTemplate
(
toscaTemplate
);
helper
.
uploadToscaTemplate
(
toscaTemplate
);
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
if
(
vmTopologies
!=
null
)
{
for
(
NodeTemplateMap
vmTopology
:
vmTopologies
)
{
for
(
NodeTemplateMap
vmTopology
:
vmTopologies
)
{
CloudsStormSubTopology
.
StatusEnum
status
=
helper
.
getVMTopologyTemplateStatus
(
vmTopology
);
CloudsStormSubTopology
.
StatusEnum
status
=
helper
.
getVMTopologyTemplateStatus
(
vmTopology
);
if
(!
status
.
equals
(
CloudsStormSubTopology
.
StatusEnum
.
DELETED
))
{
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,
...
@@ -221,9 +221,11 @@ def get_node_templates(id, type_name=None, node_name=None, has_interfaces=None,
prop
=
None
prop
=
None
queries
.
append
(
query
.
artifacts
!=
prop
)
queries
.
append
(
query
.
artifacts
!=
prop
)
query_results
=
query_db
(
queries
,
db
=
node_template_db
)
query_results
=
query_db
(
queries
,
db
=
node_template_db
)
if
query_results
:
return
change_to_node_template_model
(
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
):
def
get_tosca_template_get_dsl_definitions
(
id
,
anchors
,
derived_from
):
...
...
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