tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
description: MongoDB installation.
template_name: mongod-type
template_version: 1.0.0-SNAPSHOT
template_author: FastConnect

imports:
  - "tosca-normative-types:1.0.0-SNAPSHOT"

node_types:
  alien.nodes.Mongod:
    derived_from: tosca.nodes.DBMS
    description: >
      A node to install Mongodb.
    requirements:
      - host: tosca.nodes.Compute
        type: tosca.relationships.HostedOn
    capabilities:
      endpoint: tosca.capabilities.Endpoint.Database
    tags:
      icon: /images/mongodb.jpg
    properties:
      db_port:
        type: integer
        default: 27017
    interfaces:
      Standard:
        create: scripts/install-mongo.sh
        configure:
          inputs:
            DB_IP: { get_attribute: [HOST, ip_address] }
            DB_PORT: { get_property: [SELF, db_port] }
          implementation: scripts/configure-mongo.sh
        start: scripts/start-mongo.sh
        stop: scripts/stop-mongo.sh


tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
description: MongoDB installation.
template_name: mongod-type
template_version: 1.0.0-SNAPSHOT
template_author: FastConnect

imports:
  - "tosca-normative-types:1.0.0-SNAPSHOT"

node_types:
  alien.nodes.Mongod:
    derived_from: tosca.nodes.DBMS
    description: >
      A node to install Mongodb.
    requirements:
      - host: tosca.nodes.Compute
        type: tosca.relationships.HostedOn
    capabilities:
      endpoint: tosca.capabilities.Endpoint.Database
    tags:
      icon: /images/mongodb.jpg
    properties:
      db_port:
        type: integer
        default: 27017
        constraints:
          - in_range: [8000,9999]
    interfaces:
      Standard:
        create: scripts/install-mongo.sh
        configure:
          inputs:
            DB_IP: { get_attribute: [HOST, ip_address] }
            DB_PORT: { get_property: [SELF, db_port] }
          implementation: scripts/configure-mongo.sh
        start: scripts/start-mongo.sh
        stop: scripts/stop-mongo.sh

Add constraint for mongo port
Add constraint for mongo port
