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
7ec82d5e
Commit
7ec82d5e
authored
Nov 01, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed ids
made deep copy for tosa template
parent
7e75bf9e
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
203 additions
and
173 deletions
+203
-173
workspace.xml
drip_planner2/.idea/workspace.xml
+3
-4
OutputParameters.yml
openAPI/TOSCA/OutputParameters.yml
+21
-30
TopologyTemplate.yml
openAPI/TOSCA/TopologyTemplate.yml
+1
-1
default_controller.py
...flask-server/sure_tosca/controllers/default_controller.py
+91
-34
__init__.py
sure_tosca-flask-server/sure_tosca/models/__init__.py
+3
-3
node_template.py
sure_tosca-flask-server/sure_tosca/models/node_template.py
+2
-2
topology_template.py
...tosca-flask-server/sure_tosca/models/topology_template.py
+10
-10
tosca_template.py
sure_tosca-flask-server/sure_tosca/models/tosca_template.py
+8
-8
tosca_helper.py
sure_tosca-flask-server/sure_tosca/service/tosca_helper.py
+2
-2
tosca_template_service.py
...flask-server/sure_tosca/service/tosca_template_service.py
+59
-76
test_default_controller.py
...a-flask-server/sure_tosca/test/test_default_controller.py
+3
-3
No files found.
drip_planner2/.idea/workspace.xml
View file @
7ec82d5e
...
@@ -2,11 +2,10 @@
...
@@ -2,11 +2,10 @@
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"462ede19-adfe-472b-975e-fefefa973fe0"
name=
"Default Changelist"
comment=
""
>
<list
default=
"true"
id=
"462ede19-adfe-472b-975e-fefefa973fe0"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.
./TOSCA/application_example_2_topologies.yaml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../TOSCA/application_example_2_topologies.ya
ml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.
idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.x
ml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../openAPI/TOSCA/
TopologyTemplate.yml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../openAPI/TOSCA/TopologyTemplate
.yml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../openAPI/TOSCA/
OutputParameters.yml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../openAPI/TOSCA/OutputParameters
.yml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../sure_tosca-flask-server/sure_tosca/
models/topology_template.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../sure_tosca-flask-server/sure_tosca/models/topology_template
.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../sure_tosca-flask-server/sure_tosca/
controllers/default_controller.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../sure_tosca-flask-server/sure_tosca/controllers/default_controller
.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../sure_tosca-flask-server/sure_tosca/service/tosca_template_service.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../sure_tosca-flask-server/sure_tosca/service/tosca_template_service.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../sure_tosca-flask-server/sure_tosca/service/tosca_template_service.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../sure_tosca-flask-server/sure_tosca/service/tosca_template_service.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../sure_tosca-flask-server/sure_tosca/swagger/swagger.yaml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../sure_tosca-flask-server/sure_tosca/swagger/swagger.yaml"
afterDir=
"false"
/>
</list>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
...
...
openAPI/TOSCA/OutputParameters.yml
View file @
7ec82d5e
---
---
definitions
:
definitions
:
docsoasisopenorgtoscans201112:OutputParameters
:
Output
:
required
:
-
OutputParameter
type
:
object
properties
:
OutputParameter
:
type
:
array
items
:
"
$ref"
:
"
#/definitions/docsoasisopenorgtoscans201112:tParameter"
docsoasisopenorgtoscans201112:tParameter
:
properties
:
properties
:
name
:
name
:
type
:
string
type
:
string
type
:
type
:
type
:
string
type
:
string
description
:
type
:
string
required
:
required
:
type
:
boolean
type
:
boolean
required
:
value
:
-
name
type
:
$ref
:
"
#/definitions/Value"
-
type
Value
:
type
:
object
properties
:
lang
:
name
:
type
:
string
space
:
enum
:
-
default
-
preserve
type
:
string
type
:
string
openAPI/TOSCA/TopologyTemplate.yml
View file @
7ec82d5e
sure_tosca-flask-server/sure_tosca/controllers/default_controller.py
View file @
7ec82d5e
import
connexion
import
connexion
import
six
import
six
from
sure_tosca.models.node_template
import
NodeTemplate
# noqa: E501
from
sure_tosca.models.node_template
import
NodeTemplate
Model
# noqa: E501
from
sure_tosca.models.topology_template
import
TopologyTemplate
# noqa: E501
from
sure_tosca.models.topology_template
import
TopologyTemplate
Model
# noqa: E501
from
sure_tosca.models.tosca_template
import
ToscaTemplate
# noqa: E501
from
sure_tosca.models.tosca_template
import
ToscaTemplate
Model
# noqa: E501
from
sure_tosca
import
util
from
sure_tosca
import
util
from
sure_tosca.service
import
tosca_template_service
from
sure_tosca.service
import
tosca_template_service
...
@@ -20,7 +20,10 @@ def get_all_ancestor_properties(id, node_name): # noqa: E501
...
@@ -20,7 +20,10 @@ def get_all_ancestor_properties(id, node_name): # noqa: E501
:rtype: List[Dict[str, object]]
:rtype: List[Dict[str, object]]
"""
"""
return
tosca_template_service
.
get_all_ancestor_properties
(
id
,
node_name
)
res
=
tosca_template_service
.
get_all_ancestor_properties
(
id
,
node_name
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_all_ancestor_types
(
id
,
node_name
):
# noqa: E501
def
get_all_ancestor_types
(
id
,
node_name
):
# noqa: E501
...
@@ -35,7 +38,10 @@ def get_all_ancestor_types(id, node_name): # noqa: E501
...
@@ -35,7 +38,10 @@ def get_all_ancestor_types(id, node_name): # noqa: E501
:rtype: List[str]
:rtype: List[str]
"""
"""
return
tosca_template_service
.
get_all_ancestor_types
(
id
,
node_name
)
res
=
tosca_template_service
.
get_all_ancestor_types
(
id
,
node_name
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_ancestors_requirements
(
id
,
node_name
):
# noqa: E501
def
get_ancestors_requirements
(
id
,
node_name
):
# noqa: E501
...
@@ -50,7 +56,10 @@ def get_ancestors_requirements(id, node_name): # noqa: E501
...
@@ -50,7 +56,10 @@ def get_ancestors_requirements(id, node_name): # noqa: E501
:rtype: Dict[str, object]
:rtype: Dict[str, object]
"""
"""
return
tosca_template_service
.
get_all_ancestors_requirements
(
id
,
node_name
)
res
=
tosca_template_service
.
get_all_ancestors_requirements
(
id
,
node_name
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_dsl_definitions
(
id
,
anchors
=
None
,
derived_from
=
None
):
# noqa: E501
def
get_dsl_definitions
(
id
,
anchors
=
None
,
derived_from
=
None
):
# noqa: E501
...
@@ -67,7 +76,10 @@ def get_dsl_definitions(id, anchors=None, derived_from=None): # noqa: E501
...
@@ -67,7 +76,10 @@ def get_dsl_definitions(id, anchors=None, derived_from=None): # noqa: E501
:rtype: List[Dict[str, object]]
:rtype: List[Dict[str, object]]
"""
"""
return
tosca_template_service
.
get_tosca_template_model_by_id
(
id
)
.
dsl_definitions
res
=
tosca_template_service
.
get_tosca_template_model_by_id
(
id
)
.
dsl_definitions
if
res
:
return
res
return
'Not Found'
,
404
def
get_imports
(
id
):
# noqa: E501
def
get_imports
(
id
):
# noqa: E501
...
@@ -80,7 +92,10 @@ def get_imports(id): # noqa: E501
...
@@ -80,7 +92,10 @@ def get_imports(id): # noqa: E501
:rtype: List[Dict[str, object]]
:rtype: List[Dict[str, object]]
"""
"""
return
tosca_template_service
.
get_tosca_template_model_by_id
(
id
)
.
imports
res
=
tosca_template_service
.
get_tosca_template_model_by_id
(
id
)
.
imports
if
res
:
return
res
return
'Not Found'
,
404
def
get_node_outputs
(
id
,
node_name
):
# noqa: E501
def
get_node_outputs
(
id
,
node_name
):
# noqa: E501
...
@@ -95,7 +110,10 @@ def get_node_outputs(id, node_name): # noqa: E501
...
@@ -95,7 +110,10 @@ def get_node_outputs(id, node_name): # noqa: E501
:rtype: Dict[str, object]
:rtype: Dict[str, object]
"""
"""
return
tosca_template_service
.
get_node_outputs
(
id
,
node_name
)
res
=
tosca_template_service
.
get_node_outputs
(
id
,
node_name
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_node_properties
(
id
,
node_name
):
# noqa: E501
def
get_node_properties
(
id
,
node_name
):
# noqa: E501
...
@@ -110,7 +128,10 @@ def get_node_properties(id, node_name): # noqa: E501
...
@@ -110,7 +128,10 @@ def get_node_properties(id, node_name): # noqa: E501
:rtype: Dict[str, object]
:rtype: Dict[str, object]
"""
"""
return
tosca_template_service
.
get_node_properties
(
id
,
node_name
)
res
=
tosca_template_service
.
get_node_properties
(
id
,
node_name
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_node_requirements
(
id
,
node_name
):
# noqa: E501
def
get_node_requirements
(
id
,
node_name
):
# noqa: E501
...
@@ -125,10 +146,15 @@ def get_node_requirements(id, node_name): # noqa: E501
...
@@ -125,10 +146,15 @@ def get_node_requirements(id, node_name): # noqa: E501
:rtype: Dict[str, object]
:rtype: Dict[str, object]
"""
"""
return
tosca_template_service
.
get_node_requirements
(
id
,
node_name
)
res
=
tosca_template_service
.
get_node_requirements
(
id
,
node_name
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_node_templates
(
id
,
type_name
=
None
,
node_name
=
None
,
has_interfaces
=
None
,
has_properties
=
None
,
has_attributes
=
None
,
has_requirements
=
None
,
has_capabilities
=
None
,
has_artifacts
=
None
,
derived_from
=
None
):
# noqa: E501
def
get_node_templates
(
id
,
type_name
=
None
,
node_name
=
None
,
has_interfaces
=
None
,
has_properties
=
None
,
has_attributes
=
None
,
has_requirements
=
None
,
has_capabilities
=
None
,
has_artifacts
=
None
,
derived_from
=
None
):
# noqa: E501
"""get_node_templates
"""get_node_templates
returns nodes templates in topology # noqa: E501
returns nodes templates in topology # noqa: E501
...
@@ -156,11 +182,14 @@ def get_node_templates(id, type_name=None, node_name=None, has_interfaces=None,
...
@@ -156,11 +182,14 @@ def get_node_templates(id, type_name=None, node_name=None, has_interfaces=None,
:rtype: List[NodeTemplate]
:rtype: List[NodeTemplate]
"""
"""
re
turn
tosca_template_service
.
get_node_templates
(
id
,
type_name
=
type_name
,
node_name
=
node_name
,
re
s
=
tosca_template_service
.
get_node_templates
(
id
,
type_name
=
type_name
,
node_name
=
node_name
,
has_interfaces
=
has_interfaces
,
has_properties
=
has_properties
,
has_interfaces
=
has_interfaces
,
has_properties
=
has_properties
,
has_attributes
=
has_attributes
,
has_requirements
=
has_requirements
,
has_attributes
=
has_attributes
,
has_requirements
=
has_requirements
,
has_capabilities
=
has_capabilities
,
has_artifacts
=
has_artifacts
,
has_capabilities
=
has_capabilities
,
has_artifacts
=
has_artifacts
,
derived_from
=
derived_from
)
derived_from
=
derived_from
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_node_type_name
(
id
,
node_name
):
# noqa: E501
def
get_node_type_name
(
id
,
node_name
):
# noqa: E501
...
@@ -175,7 +204,10 @@ def get_node_type_name(id, node_name): # noqa: E501
...
@@ -175,7 +204,10 @@ def get_node_type_name(id, node_name): # noqa: E501
:rtype: str
:rtype: str
"""
"""
return
tosca_template_service
.
get_node_type_name
(
id
,
node_name
)
res
=
tosca_template_service
.
get_node_type_name
(
id
,
node_name
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_parent_type_name
(
id
,
node_name
):
# noqa: E501
def
get_parent_type_name
(
id
,
node_name
):
# noqa: E501
...
@@ -190,7 +222,10 @@ def get_parent_type_name(id, node_name): # noqa: E501
...
@@ -190,7 +222,10 @@ def get_parent_type_name(id, node_name): # noqa: E501
:rtype: str
:rtype: str
"""
"""
return
tosca_template_service
.
get_parent_type_name
(
id
,
node_name
)
res
=
tosca_template_service
.
get_parent_type_name
(
id
,
node_name
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_related_nodes
(
id
,
node_name
):
# noqa: E501
def
get_related_nodes
(
id
,
node_name
):
# noqa: E501
...
@@ -205,7 +240,10 @@ def get_related_nodes(id, node_name): # noqa: E501
...
@@ -205,7 +240,10 @@ def get_related_nodes(id, node_name): # noqa: E501
:rtype: List[NodeTemplate]
:rtype: List[NodeTemplate]
"""
"""
return
tosca_template_service
.
get_related_nodes
(
id
,
node_name
)
res
=
tosca_template_service
.
get_related_nodes
(
id
,
node_name
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_relationship_templates
(
id
,
type_name
=
None
,
derived_from
=
None
):
# noqa: E501
def
get_relationship_templates
(
id
,
type_name
=
None
,
derived_from
=
None
):
# noqa: E501
...
@@ -222,7 +260,10 @@ def get_relationship_templates(id, type_name=None, derived_from=None): # noqa:
...
@@ -222,7 +260,10 @@ def get_relationship_templates(id, type_name=None, derived_from=None): # noqa:
:rtype: List[Dict[str, object]]
:rtype: List[Dict[str, object]]
"""
"""
return
tosca_template_service
.
get_relationship_templates
(
id
,
type_name
=
type_name
,
derived_from
=
derived_from
)
res
=
tosca_template_service
.
get_relationship_templates
(
id
,
type_name
=
type_name
,
derived_from
=
derived_from
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_topology_template
(
id
):
# noqa: E501
def
get_topology_template
(
id
):
# noqa: E501
...
@@ -233,9 +274,12 @@ def get_topology_template(id): # noqa: E501
...
@@ -233,9 +274,12 @@ def get_topology_template(id): # noqa: E501
:param id: ID of topolog template uplodaed
:param id: ID of topolog template uplodaed
:type id: str
:type id: str
:rtype: TopologyTemplate
:rtype: TopologyTemplate
Model
"""
"""
return
tosca_template_service
.
get_tosca_template_dict_by_id
(
id
)
res
=
tosca_template_service
.
get_tosca_template_model_by_id
(
id
)
.
topology_template
if
res
:
return
res
return
'Not Found'
,
404
def
get_tosca_template
(
id
):
# noqa: E501
def
get_tosca_template
(
id
):
# noqa: E501
...
@@ -246,12 +290,16 @@ def get_tosca_template(id): # noqa: E501
...
@@ -246,12 +290,16 @@ def get_tosca_template(id): # noqa: E501
:param id: ID of topolog template uplodaed
:param id: ID of topolog template uplodaed
:type id: str
:type id: str
:rtype: ToscaTemplate
:rtype: ToscaTemplate
Model
"""
"""
return
tosca_template_service
.
get_tosca_template_model_by_id
(
id
)
res
=
tosca_template_service
.
get_tosca_template_model_by_id
(
id
)
if
res
:
return
res
return
'Not Found'
,
404
def
get_types
(
id
,
kind_of_type
=
None
,
has_interfaces
=
None
,
type_name
=
None
,
has_properties
=
None
,
has_attributes
=
None
,
has_requirements
=
None
,
has_capabilities
=
None
,
has_artifacts
=
None
,
derived_from
=
None
):
# noqa: E501
def
get_types
(
id
,
kind_of_type
=
None
,
has_interfaces
=
None
,
type_name
=
None
,
has_properties
=
None
,
has_attributes
=
None
,
has_requirements
=
None
,
has_capabilities
=
None
,
has_artifacts
=
None
,
derived_from
=
None
):
# noqa: E501
"""
"""
returns the interface types # noqa: E501
returns the interface types # noqa: E501
...
@@ -279,11 +327,14 @@ def get_types(id, kind_of_type=None, has_interfaces=None, type_name=None, has_pr
...
@@ -279,11 +327,14 @@ def get_types(id, kind_of_type=None, has_interfaces=None, type_name=None, has_pr
:rtype: List[Dict[str, object]]
:rtype: List[Dict[str, object]]
"""
"""
re
turn
tosca_template_service
.
get_types
(
id
,
kind_of_type
=
kind_of_type
,
has_interfaces
=
has_interfaces
,
re
s
=
tosca_template_service
.
get_types
(
id
,
kind_of_type
=
kind_of_type
,
has_interfaces
=
has_interfaces
,
type_name
=
type_name
,
has_properties
=
has_properties
,
type_name
=
type_name
,
has_properties
=
has_properties
,
has_attributes
=
has_attributes
,
has_requirements
=
has_requirements
,
has_attributes
=
has_attributes
,
has_requirements
=
has_requirements
,
has_capabilities
=
has_capabilities
,
has_artifacts
=
has_artifacts
,
has_capabilities
=
has_capabilities
,
has_artifacts
=
has_artifacts
,
derived_from
=
derived_from
)
derived_from
=
derived_from
)
if
res
:
return
res
return
'Not Found'
,
404
def
set_node_properties
(
id
,
properties
,
node_name
):
# noqa: E501
def
set_node_properties
(
id
,
properties
,
node_name
):
# noqa: E501
...
@@ -298,9 +349,12 @@ def set_node_properties(id, properties, node_name): # noqa: E501
...
@@ -298,9 +349,12 @@ def set_node_properties(id, properties, node_name): # noqa: E501
:param node_name: node_name
:param node_name: node_name
:type node_name: str
:type node_name: str
:rtype: NodeTemplate
:rtype: NodeTemplate
Model
"""
"""
return
tosca_template_service
.
set_node_properties
(
id
,
properties
,
node_name
)
res
=
tosca_template_service
.
set_node_properties
(
id
,
properties
,
node_name
)
if
res
:
return
res
return
'Not Found'
,
404
def
upload_tosca_template
(
file
):
# noqa: E501
def
upload_tosca_template
(
file
):
# noqa: E501
...
@@ -313,4 +367,7 @@ def upload_tosca_template(file): # noqa: E501
...
@@ -313,4 +367,7 @@ def upload_tosca_template(file): # noqa: E501
:rtype: str
:rtype: str
"""
"""
return
tosca_template_service
.
save
(
file
)
res
=
tosca_template_service
.
save
(
file
)
if
res
:
return
res
return
'Bad Request'
,
400
sure_tosca-flask-server/sure_tosca/models/__init__.py
View file @
7ec82d5e
...
@@ -3,6 +3,6 @@
...
@@ -3,6 +3,6 @@
# flake8: noqa
# flake8: noqa
from
__future__
import
absolute_import
from
__future__
import
absolute_import
# import models into model package
# import models into model package
from
sure_tosca.models.node_template
import
NodeTemplate
from
sure_tosca.models.node_template
import
NodeTemplate
Model
from
sure_tosca.models.topology_template
import
TopologyTemplate
from
sure_tosca.models.topology_template
import
TopologyTemplate
Model
from
sure_tosca.models.tosca_template
import
ToscaTemplate
from
sure_tosca.models.tosca_template
import
ToscaTemplate
Model
sure_tosca-flask-server/sure_tosca/models/node_template.py
View file @
7ec82d5e
...
@@ -9,7 +9,7 @@ from sure_tosca.models.base_model_ import Model
...
@@ -9,7 +9,7 @@ from sure_tosca.models.base_model_ import Model
from
sure_tosca
import
util
from
sure_tosca
import
util
class
NodeTemplate
(
Model
):
class
NodeTemplate
Model
(
Model
):
"""NOTE: This class is auto generated by the swagger code generator program.
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Do not edit the class manually.
...
@@ -84,7 +84,7 @@ class NodeTemplate(Model):
...
@@ -84,7 +84,7 @@ class NodeTemplate(Model):
:param dikt: A dict.
:param dikt: A dict.
:type: dict
:type: dict
:return: The NodeTemplate of this NodeTemplate. # noqa: E501
:return: The NodeTemplate of this NodeTemplate. # noqa: E501
:rtype: NodeTemplate
:rtype: NodeTemplate
Model
"""
"""
return
util
.
deserialize_model
(
dikt
,
cls
)
return
util
.
deserialize_model
(
dikt
,
cls
)
...
...
sure_tosca-flask-server/sure_tosca/models/topology_template.py
View file @
7ec82d5e
...
@@ -5,12 +5,12 @@ from datetime import date, datetime # noqa: F401
...
@@ -5,12 +5,12 @@ from datetime import date, datetime # noqa: F401
from
typing
import
List
,
Dict
# noqa: F401
from
typing
import
List
,
Dict
# noqa: F401
from
sure_tosca.models
import
NodeTemplate
from
sure_tosca.models
import
NodeTemplate
Model
from
sure_tosca.models.base_model_
import
Model
from
sure_tosca.models.base_model_
import
Model
from
sure_tosca
import
util
from
sure_tosca
import
util
class
TopologyTemplate
(
Model
):
class
TopologyTemplate
Model
(
Model
):
"""NOTE: This class is auto generated by the swagger code generator program.
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Do not edit the class manually.
...
@@ -24,11 +24,11 @@ class TopologyTemplate(Model):
...
@@ -24,11 +24,11 @@ class TopologyTemplate(Model):
:param inputs: The inputs of this TopologyTemplate. # noqa: E501
:param inputs: The inputs of this TopologyTemplate. # noqa: E501
:type inputs: List[Dict[str, object]]
:type inputs: List[Dict[str, object]]
:param node_templates: The node_templates of this TopologyTemplate. # noqa: E501
:param node_templates: The node_templates of this TopologyTemplate. # noqa: E501
:type node_templates: Dict[str, NodeTemplate]
:type node_templates: Dict[str, NodeTemplate
Model
]
:param relationship_templates: The relationship_templates of this TopologyTemplate. # noqa: E501
:param relationship_templates: The relationship_templates of this TopologyTemplate. # noqa: E501
:type relationship_templates: Dict[str, object]
:type relationship_templates: Dict[str, object]
:param outputs: The outputs of this TopologyTemplate. # noqa: E501
:param outputs: The outputs of this TopologyTemplate. # noqa: E501
:type outputs:
str
:type outputs:
Dict[str, object]
:param groups: The groups of this TopologyTemplate. # noqa: E501
:param groups: The groups of this TopologyTemplate. # noqa: E501
:type groups: Dict[str, object]
:type groups: Dict[str, object]
:param substitution_mappings: The substitution_mappings of this TopologyTemplate. # noqa: E501
:param substitution_mappings: The substitution_mappings of this TopologyTemplate. # noqa: E501
...
@@ -39,9 +39,9 @@ class TopologyTemplate(Model):
...
@@ -39,9 +39,9 @@ class TopologyTemplate(Model):
self
.
swagger_types
=
{
self
.
swagger_types
=
{
'description'
:
str
,
'description'
:
str
,
'inputs'
:
List
[
Dict
[
str
,
object
]],
'inputs'
:
List
[
Dict
[
str
,
object
]],
'node_templates'
:
Dict
[
str
,
NodeTemplate
],
'node_templates'
:
Dict
[
str
,
NodeTemplate
Model
],
'relationship_templates'
:
Dict
[
str
,
object
],
'relationship_templates'
:
Dict
[
str
,
object
],
'outputs'
:
str
,
'outputs'
:
Dict
[
str
,
object
]
,
'groups'
:
Dict
[
str
,
object
],
'groups'
:
Dict
[
str
,
object
],
'substitution_mappings'
:
Dict
[
str
,
object
],
'substitution_mappings'
:
Dict
[
str
,
object
],
'policies'
:
List
[
Dict
[
str
,
object
]]
'policies'
:
List
[
Dict
[
str
,
object
]]
...
@@ -74,7 +74,7 @@ class TopologyTemplate(Model):
...
@@ -74,7 +74,7 @@ class TopologyTemplate(Model):
:param dikt: A dict.
:param dikt: A dict.
:type: dict
:type: dict
:return: The TopologyTemplate of this TopologyTemplate. # noqa: E501
:return: The TopologyTemplate of this TopologyTemplate. # noqa: E501
:rtype: TopologyTemplate
:rtype: TopologyTemplate
Model
"""
"""
return
util
.
deserialize_model
(
dikt
,
cls
)
return
util
.
deserialize_model
(
dikt
,
cls
)
...
@@ -126,7 +126,7 @@ class TopologyTemplate(Model):
...
@@ -126,7 +126,7 @@ class TopologyTemplate(Model):
:return: The node_templates of this TopologyTemplate.
:return: The node_templates of this TopologyTemplate.
:rtype: Dict[str, NodeTemplate]
:rtype: Dict[str, NodeTemplate
Model
]
"""
"""
return
self
.
_node_templates
return
self
.
_node_templates
...
@@ -136,7 +136,7 @@ class TopologyTemplate(Model):
...
@@ -136,7 +136,7 @@ class TopologyTemplate(Model):
:param node_templates: The node_templates of this TopologyTemplate.
:param node_templates: The node_templates of this TopologyTemplate.
:type node_templates: Dict[str, NodeTemplate]
:type node_templates: Dict[str, NodeTemplate
Model
]
"""
"""
self
.
_node_templates
=
node_templates
self
.
_node_templates
=
node_templates
...
@@ -247,6 +247,6 @@ class TopologyTemplate(Model):
...
@@ -247,6 +247,6 @@ class TopologyTemplate(Model):
self
.
_policies
=
policies
self
.
_policies
=
policies
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
TopologyTemplate
):
if
isinstance
(
other
,
TopologyTemplate
Model
):
return
self
.
__key
()
==
other
.
__key
()
return
self
.
__key
()
==
other
.
__key
()
return
NotImplemented
return
NotImplemented
\ No newline at end of file
sure_tosca-flask-server/sure_tosca/models/tosca_template.py
View file @
7ec82d5e
...
@@ -5,12 +5,12 @@ from datetime import date, datetime # noqa: F401
...
@@ -5,12 +5,12 @@ from datetime import date, datetime # noqa: F401
from
typing
import
List
,
Dict
# noqa: F401
from
typing
import
List
,
Dict
# noqa: F401
from
sure_tosca.models
import
TopologyTemplate
from
sure_tosca.models
import
TopologyTemplate
Model
from
sure_tosca.models.base_model_
import
Model
from
sure_tosca.models.base_model_
import
Model
from
sure_tosca
import
util
from
sure_tosca
import
util
class
ToscaTemplate
(
Model
):
class
ToscaTemplate
Model
(
Model
):
"""NOTE: This class is auto generated by the swagger code generator program.
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Do not edit the class manually.
...
@@ -30,7 +30,7 @@ class ToscaTemplate(Model):
...
@@ -30,7 +30,7 @@ class ToscaTemplate(Model):
:param template_name: The template_name of this ToscaTemplate. # noqa: E501
:param template_name: The template_name of this ToscaTemplate. # noqa: E501
:type template_name: str
:type template_name: str
:param topology_template: The topology_template of this ToscaTemplate. # noqa: E501
:param topology_template: The topology_template of this ToscaTemplate. # noqa: E501
:type topology_template: TopologyTemplate
:type topology_template: TopologyTemplate
Model
:param template_author: The template_author of this ToscaTemplate. # noqa: E501
:param template_author: The template_author of this ToscaTemplate. # noqa: E501
:type template_author: str
:type template_author: str
:param template_version: The template_version of this ToscaTemplate. # noqa: E501
:param template_version: The template_version of this ToscaTemplate. # noqa: E501
...
@@ -66,7 +66,7 @@ class ToscaTemplate(Model):
...
@@ -66,7 +66,7 @@ class ToscaTemplate(Model):
'tosca_definitions_version'
:
str
,
'tosca_definitions_version'
:
str
,
'tosca_default_namespace'
:
str
,
'tosca_default_namespace'
:
str
,
'template_name'
:
str
,
'template_name'
:
str
,
'topology_template'
:
TopologyTemplate
,
'topology_template'
:
TopologyTemplate
Model
,
'template_author'
:
str
,
'template_author'
:
str
,
'template_version'
:
str
,
'template_version'
:
str
,
'description'
:
str
,
'description'
:
str
,
...
@@ -133,7 +133,7 @@ class ToscaTemplate(Model):
...
@@ -133,7 +133,7 @@ class ToscaTemplate(Model):
:param dikt: A dict.
:param dikt: A dict.
:type: dict
:type: dict
:return: The ToscaTemplate of this ToscaTemplate. # noqa: E501
:return: The ToscaTemplate of this ToscaTemplate. # noqa: E501
:rtype: ToscaTemplate
:rtype: ToscaTemplate
Model
"""
"""
return
util
.
deserialize_model
(
dikt
,
cls
)
return
util
.
deserialize_model
(
dikt
,
cls
)
...
@@ -206,7 +206,7 @@ class ToscaTemplate(Model):
...
@@ -206,7 +206,7 @@ class ToscaTemplate(Model):
:return: The topology_template of this ToscaTemplate.
:return: The topology_template of this ToscaTemplate.
:rtype: TopologyTemplate
:rtype: TopologyTemplate
Model
"""
"""
return
self
.
_topology_template
return
self
.
_topology_template
...
@@ -216,7 +216,7 @@ class ToscaTemplate(Model):
...
@@ -216,7 +216,7 @@ class ToscaTemplate(Model):
:param topology_template: The topology_template of this ToscaTemplate.
:param topology_template: The topology_template of this ToscaTemplate.
:type topology_template: TopologyTemplate
:type topology_template: TopologyTemplate
Model
"""
"""
self
.
_topology_template
=
topology_template
self
.
_topology_template
=
topology_template
...
@@ -537,6 +537,6 @@ class ToscaTemplate(Model):
...
@@ -537,6 +537,6 @@ class ToscaTemplate(Model):
self
.
_repositories
=
repositories
self
.
_repositories
=
repositories
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
ToscaTemplate
):
if
isinstance
(
other
,
ToscaTemplate
Model
):
return
self
.
__key
()
==
other
.
__key
()
return
self
.
__key
()
==
other
.
__key
()
return
NotImplemented
return
NotImplemented
sure_tosca-flask-server/sure_tosca/service/tosca_helper.py
View file @
7ec82d5e
...
@@ -108,13 +108,13 @@ def get_node_types_with_interface(nodes):
...
@@ -108,13 +108,13 @@ def get_node_types_with_interface(nodes):
def
node_dict_2_node_template
(
node_dict
,
all_custom_def
):
def
node_dict_2_node_template
(
node_dict
,
all_custom_def
):
node_name
=
next
(
iter
(
node_dict
))
node_name
=
next
(
iter
(
node_dict
))
node_type
=
node_dict
[
node_name
][
'type'
]
#
node_type = node_dict[node_name]['type']
# for name_to_remove in node_type_key_names_to_remove:
# for name_to_remove in node_type_key_names_to_remove:
# if name_to_remove in node_dict[node_name][node_name]:
# if name_to_remove in node_dict[node_name][node_name]:
# node_dict[node_name].pop(name_to_remove)
# node_dict[node_name].pop(name_to_remove)
node_template
=
NodeTemplate
(
node_name
,
node_templates
=
node_dict
,
custom_def
=
all_custom_def
)
node_template
=
NodeTemplate
(
node_name
,
node_templates
=
copy
.
deepcopy
(
node_dict
)
,
custom_def
=
all_custom_def
)
# For some reason the tosca.nodes.ARTICONF.Orchestrator doesn't have all definitions so we need to add them
# For some reason the tosca.nodes.ARTICONF.Orchestrator doesn't have all definitions so we need to add them
# manually. We get 'toscaparser.common.exception.InvalidTypeError: Type "tosca.nodes.ARTICONF.Orchestrator"
# manually. We get 'toscaparser.common.exception.InvalidTypeError: Type "tosca.nodes.ARTICONF.Orchestrator"
# is not a valid type.'
# is not a valid type.'
...
...
sure_tosca-flask-server/sure_tosca/service/tosca_template_service.py
View file @
7ec82d5e
This diff is collapsed.
Click to expand it.
sure_tosca-flask-server/sure_tosca/test/test_default_controller.py
View file @
7ec82d5e
...
@@ -5,9 +5,9 @@ from __future__ import absolute_import
...
@@ -5,9 +5,9 @@ from __future__ import absolute_import
from
flask
import
json
from
flask
import
json
from
six
import
BytesIO
from
six
import
BytesIO
from
sure_tosca.models.node_template
import
NodeTemplate
# noqa: E501
from
sure_tosca.models.node_template
import
NodeTemplate
Model
# noqa: E501
from
sure_tosca.models.topology_template
import
TopologyTemplate
# noqa: E501
from
sure_tosca.models.topology_template
import
TopologyTemplate
Model
# noqa: E501
from
sure_tosca.models.tosca_template
import
ToscaTemplate
# noqa: E501
from
sure_tosca.models.tosca_template
import
ToscaTemplate
Model
# noqa: E501
from
sure_tosca.test
import
BaseTestCase
from
sure_tosca.test
import
BaseTestCase
...
...
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