tosca_definitions_version: tosca_simple_yaml_1_0

node_types:

  tosca.nodes.ARTICONF.Root:
    description: root ARTICONF node

  tosca.nodes.ARTICONF.Container.Application.Docker:
    derived_from:  tosca.nodes.ARTICONF.Root
    description: description of container
    properties:
      ports:
        description: ports to be forwarded
        type: list
        required: false      
      entrypoint:
        description: command
        type: string
        required: false
      cmd:
        description: cmd
        type: string
        required: false
      environment:
        description: environment variables
        type: map
        required: false
      volumes:
        description: volume
        type: list
        required: false
    requirements:
      - host:
          capability: tosca.capabilities.ARTICONF.Orchestrator
          node: tosca.nodes.ARTICONF.Orchestrator
          relationship: tosca.relationships.HostedOn         
          
  tosca.nodes.ARTICONF.Orchestrator:
    derived_from: tosca.nodes.ARTICONF.Root
    description: a container orchestrator
    requirements:
      - host:
          capability: tosca.capabilities.ARTICONF.VM.topology
          node: tosca.nodes.ARTICONF.VM.topology
          relationship: tosca.relationships.HostedOn
    capabilities:
      orchestrator:
        type: tosca.capabilities.ARTICONF.Orchestrator
      host:
        type: tosca.capabilities.Container.Docker
      container:
        type: tosca.capabilities.Container        
    properties:
        masters_num:
            type: integer
            required: true
            default: 1
            constraints:
            - greater_or_equal: 1
        workers_num:
            type: integer
            required: true
            default: 1
            constraints:
            - greater_or_equal: 1
        
    
    
  tosca.nodes.ARTICONF.Orchestrator.Kubernetes:
    derived_from: tosca.nodes.ARTICONF.Orchestrator
    description: Kubernetes orchestrator
    interfaces:
      Standard:
        create: interfaces/playbooks/kubernetes_install.yaml
        
  #tosca.nodes.ARTICONF.Orchestrator.Swarm:
    #derived_from: tosca.nodes.ARTICONF.Orchestrator
    #description: swarm orchestrator
    #interfaces:
      #Standard:
        #create: interfaces/playbooks/docker_swarm_install.yaml            
        
  tosca.nodes.ARTICONF.VM.topology:
    derived_from: tosca.nodes.ARTICONF.Infrastructure
    description: topology of VMs
    requirements:
      - vm:
          capability: tosca.capabilities.ARTICONF.VM
          node: tosca.nodes.ARTICONF.Infrastructure
          relationship: tosca.relationships.DependsOn
    capabilities:
      scalable:
        type: tosca.capabilities.Scalable 
      topology:
        type: tosca.capabilities.ARTICONF.VM.topology
    properties:
      provider:
        type: string
        required: true
        default: "ExoGeni"
        description: The name of the provider e.g. EC2, ExoGeni etc. 
      name:
        type: string
        required: false
        description: the name of this topology
      domain:        
        type: string
        required: true
        default: "UvA (Amsterdam, The Netherlands) XO Rack"
        description: the domain of this topology e.g. California, UvA, etc
      credential:
        type: tosca.datatypes.Credential
        required: false
      subnet:
        type: string
        required: false
        description: The subnet of the VMs this topology e.g. 192.168.10.10/24
    interfaces:
      Standard:
        create: dumy.yaml
        
  tosca.nodes.ARTICONF.VM.Compute:
    derived_from: tosca.nodes.ARTICONF.Infrastructure
    description: vm
    capabilities:
      compute:
        type: tosca.capabilities.ARTICONF.VM
    properties:
      user_name:
        type: string
        required: true
        default: "vm_user"
      host_name:
        type: string
        required: true
        default: "vm"
      num_cores:
        type: integer
        required: true
        default: 2
        constraints:
          - greater_or_equal: 1
      cpu_frequency:
        type: scalar-unit.frequency
        required: false
        constraints:
          - greater_or_equal: 0.5 GHz
      disk_size:
        type: scalar-unit.size
        required: true
        default: 50000 MB
        constraints:
          - greater_or_equal: 15000 MB
      mem_size:
        type: scalar-unit.size
        required: true
        default: 6000 MB
        constraints:
          - greater_or_equal: 500 MB
      os:
        type: string
        required: true       
        default: "ubuntu 16"
      role:
        type: string
        required: true       
        description: the role of the VM in the topology
        default: "master"
        constraints:
            - valid_values: [ "master","worker" ]  
      private_ip:
        type: string
        required: false
        description: The private IP of the VM e.g. 192.168.10.10
      node_type:
        type: string
        required: false
        description: the type of VM depending on the provider. e.g. XOSmall, t.medium etc. It has to match the mem_size, num_cores etc.
        
    interfaces:
      Standard:
        create: dumy.yaml        
    
    
        
  tosca.nodes.ARTICONF.Infrastructure:
    derived_from:  tosca.nodes.ARTICONF.Root
    description: Base infrastructure node
    capabilities:
      compute:
        type: tosca.capabilities.Compute
      node:
        type: tosca.capabilities.Node
