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
fb075c17
Commit
fb075c17
authored
May 03, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get relationships
parent
9a3a26eb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
__main__.py
tosca_service/src/__main__.py
+10
-8
service.py
tosca_service/src/winery/service.py
+4
-0
No files found.
tosca_service/src/__main__.py
View file @
fb075c17
...
@@ -8,30 +8,32 @@ import os
...
@@ -8,30 +8,32 @@ import os
import
os.path
import
os.path
from
os.path
import
expanduser
from
os.path
import
expanduser
import
pika
import
pika
from
winery.service
import
*
import
sys
import
sys
import
tempfile
import
tempfile
import
time
import
time
from
winery.service
import
*
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
tosca_reposetory_api_base_url
=
"http://localhost:8080/winery"
tosca_reposetory_api_base_url
=
"http://localhost:8080/winery"
namespace
=
"http
%253
A
%252
F
%252
Fsne.uva.nl
%252
Fservicetemplates"
namespace
=
"http
%253
A
%252
F
%252
Fsne.uva.nl
%252
Fservicetemplates"
servicetemplate_id
=
"wordpress_w1-wip1"
servicetemplate_id
=
"wordpress_w1-wip1"
repo
=
Service
(
tosca_reposetory_api_base_url
)
repo
=
Service
(
tosca_reposetory_api_base_url
)
servicetemplates
=
repo
.
get_servicetemplates
(
namespace
,
servicetemplate_id
)
servicetemplates
=
repo
.
get_servicetemplates
(
namespace
,
servicetemplate_id
)
tt
=
repo
.
get_topology_template
(
servicetemplates
)
tt
=
repo
.
get_topology_template
(
servicetemplates
)
node_templates
=
repo
.
get_node_templates
(
tt
)
node_templates
=
repo
.
get_node_templates
(
tt
)
relationships
=
repo
.
get_relationships
(
tt
)
requrements
=
repo
.
get_all_requirements
(
node_templates
[
1
]
)
print
(
relationships
)
# print(requrements)
# requrements = repo.get_all_requirements(node_templates[1])
capabilities
=
repo
.
get_all_capabilities
(
node_templates
[
1
]
)
# unmet_requrements = repo.get_unmet_requrements(node_templates[1], tt
)
print
(
capabilities
)
# capabilities = repo.get_all_capabilities(node_templates[1])
# print(capabilities)
...
...
tosca_service/src/winery/service.py
View file @
fb075c17
...
@@ -84,6 +84,10 @@ class Service:
...
@@ -84,6 +84,10 @@ class Service:
requrements_types
.
add
(
p_req
[
'requirementType'
])
requrements_types
.
add
(
p_req
[
'requirementType'
])
return
requrements
return
requrements
def
get_relationships
(
self
,
topology_template
):
return
self
.
find
(
topology_template
,
self
.
relationships_names
)
def
get_all_capabilities
(
self
,
node_template
):
def
get_all_capabilities
(
self
,
node_template
):
parents
=
self
.
get_parents
(
node_template
)
parents
=
self
.
get_parents
(
node_template
)
node_type
=
self
.
get_object
(
node_template
[
'type'
])[
'serviceTemplateOrNodeTypeOrNodeTypeImplementation'
][
0
]
node_type
=
self
.
get_object
(
node_template
[
'type'
])[
'serviceTemplateOrNodeTypeOrNodeTypeImplementation'
][
0
]
...
...
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