Commit d40869d5 authored by Spiros Koulouzis's avatar Spiros Koulouzis

define Orchestrator and capabilities

parent 0e9b7d25
tosca_definitions_version: tosca_simple_yaml_1_0
imports:
- indigo_custom_types: types/nodes.yaml
- nodes: types/nodes.yaml
- capabilities: types/capabilities.yaml
description: >
TOSCA example
......@@ -10,7 +11,7 @@ topology_template:
node_templates:
wordpress:
type: tosca.nodes.SWITCH.Container.Application.Docker
type: tosca.nodes.ARTICONF.Container.Application.Docker
requirements:
- service:
node: mysql
......@@ -32,7 +33,7 @@ topology_template:
WORDPRESS_DB_NAME: wordpress
mysql:
type: tosca.nodes.SWITCH.Container.Application.Docker
type: tosca.nodes.ARTICONF.Container.Application.Docker
properties:
volumes:
- db_data:/var/lib/mysql
......
tosca_definitions_version: tosca_simple_yaml_1_0
capability_types:
tosca.capabilities.ARTICONF.Orchestrator:
derived_from: tosca.capabilities.Container
properties:
some_properties:
type: string
required: no
......@@ -2,7 +2,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
node_types:
tosca.nodes.SWITCH.Container.Application.Docker:
tosca.nodes.ARTICONF.Container.Application.Docker:
#derived_from: tosca.nodes.Container.Application.Docker
description: description of container
capabilities:
......@@ -31,6 +31,31 @@ node_types:
required: false
requirements:
- host:
capability: tosca.capabilities.Compute
capability: tosca.capabilities.ARTICONF.Orchestrator
node: tosca.nodes.ARTICONF.Orchestrator
relationship: tosca.relationships.HostedOn
tosca.nodes.ARTICONF.Orchestrator:
derived_from: tosca.nodes.SoftwareComponent
description: a container orchestrator
requirements:
- host:
capability: tosca.capabilities.Container
node: tosca.nodes.Compute
relationship: tosca.relationships.HostedOn
capabilities:
host:
type: tosca.capabilities.ARTICONF.Orchestrator
tosca.nodes.ARTICONF.Orchestrator.Kubernetes:
derived_from: tosca.nodes.ARTICONF.Orchestrator
description: Kubernetes orchestrator
requirements:
- host:
capability: tosca.capabilities.Scalable
node: tosca.nodes.Compute
relationship: tosca.relationships.HostedOn
......@@ -22,10 +22,9 @@ class BasicPlanner:
for node in self.template.nodetemplates:
missing_requirements = self.get_missing_requirements(node)
print(missing_requirements)
for req in missing_requirements:
node.requirements.append(req)
print('----------------------')
# print(node.get_properties().keys())
# print(node.get_capabilities().keys)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment