File: telnet_example.rst

package info (click to toggle)
murano 1%3A6.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,644 kB
  • sloc: python: 34,127; sh: 717; pascal: 269; makefile: 83
file content (48 lines) | stat: -rw-r--r-- 1,511 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
:orphan:

.. _telnet_example:

Telnet Example
--------------

.. code-block:: yaml

    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 Instance.')
          # 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.')