deb-murano/doc/source/articles/telnet_example.rst
Tin Lam 41be239462 Removed warnings from building docs
Removed all warnings from running 'tox -e docs'.
Setting warnerrors = true in setup.cfg.

Change-Id: I00438f6a505d696fa5d1261a4f016118bdd4faf1
Closes-Bug: #1561985
2016-03-28 02:36:58 -05:00

2.0 KiB

Telnet Example

Namespaces:
  =: io.murano.apps.linux
  std: io.murano
  res: io.murano.resources


Name: Telnet

# Inheritance from io.murano.Application class
# (located at Murano Core library) indicates,
# that this is a complete application
# and that 'deploy' method has to be defined.
Extends: std:Application

Properties:
  name:
    Contract: $.string().notNull()

  instance:
    Contract: $.class(res:Instance).notNull()


Methods:
  deploy:
    Body:
      # Determine the environment to which the application belongs.
      # This message will be stored in deployment logs and available in UI
      - $this.find(std:Environment).reporter.report($this, 'Creating VM for Telnet instace.')
      # Deploy VM
      - $.instance.deploy()
      - $this.find(std:Environment).reporter.report($this, 'Instance is created. Setup Telnet service.')
      # Create instance of murano resource class. Agent will use it to find
      # corresponding execution plan by the file name
      - $resources: new('io.murano.system.Resources')
      # Deploy Telnet
      - $template: $resources.yaml('DeployTelnet.template')
      # Send prepared execution plan to Murano agent
      - $.instance.agent.call($template, $resources)
      - $this.find(std:Environment).reporter.report($this, 'Telnet service setup is done.')