Jump to: navigation, search

Difference between revisions of "Murano/Documentation/DynamicUI"

Line 1: Line 1:
 
=Dynamic UI Definition Manual=
 
=Dynamic UI Definition Manual=
  
The main purpose of Dynamic UI is to generate application creation forms "on-the-fly". Murano dashboard doesn't know anything about what applications can be deployed and witch web form need to be used to create application instance. So all application definitions should contain yaml file which will tell dashboard now to create application and what validation  to be apply. This document will help you to compose valid UI definition to your application.  
+
The main purpose of Dynamic UI is to generate application creation forms "on-the-fly". Murano dashboard doesn't know anything about what applications can be deployed and witch web form need to be used to create application instance. So all application definitions should contain a yaml file which will tell dashboard now to create an application and what validation  to be applied. This document will help you to compose a valid UI definition to your application.  
  
 
== Structure ==
 
== Structure ==
 
UI definition should be a valid yaml file and should contain the following sections (for version 2):
 
UI definition should be a valid yaml file and should contain the following sections (for version 2):
 
* Version - points out to which syntax version is used
 
* Version - points out to which syntax version is used
* Templates - auxiliary section, using togeher with Apllication
+
* Templates - auxiliary section, using together with an Application section
 
* Application - object model description which will be used in application deployment
 
* Application - object model description which will be used in application deployment
* Forms - web forms defenitions
+
* Forms - web form definitions
  
 
==== Version ====
 
==== Version ====
Line 14: Line 14:
  
 
==== Application and Templates ====
 
==== Application and Templates ====
In Application section "application object model" is described. This model will be translated into json and according to it application will be deployed.  
+
In the Application section "application object model" is described. This model will be translated into json and according to that json application will be deployed.  
Application section should contains all nessasary keys that required for murano-engine to deploy an application. Note that under ''?'' section goes system part of the model.
+
Application section should contain all necessary keys that required for murano-engine to deploy an application. Note that under ''?'' section goes system part of the model.
 +
You can pick parameters you got from the user (they should be described in the Forms section) and pick the right place where they should be set. To do this [https://github.com/tsufiev/yaql/blob/master/README.md YAQL] is used:
 +
* way of setting variables ($ as the first symbol)
 +
* ''repeat'' function
 +
* ''interpolate'' functions
 +
 
 
Example:
 
Example:
 
''
 
''
Line 28: Line 33:
 
         secondaryControllers: repeat($secondaryController, 2, $.serviceConfiguration.dcInstances + 1)
 
         secondaryControllers: repeat($secondaryController, 2, $.serviceConfiguration.dcInstances + 1)
 
''
 
''
 
+
==== Forms ====
Here you can pick parameters you got from user (they should be described in the Forms section) and pick the right place where they should be set . To do this part of [https://github.com/tsufiev/yaql/blob/master/README.md YAQL] is used:  
+
This section describes Django forms. Set name for your form and provide fields and validators.
* way of setting variables ($ as the first symbol)
+
Each field should contain:
* ''repeat'' function
+
* name
* ''interpolate'' functions
+
* type
 
+
* label
==== FOrms ====
+
* description.
===supported types===
+
Supported field types, which support build-in validation:
'string': fields.CharField,
+
* string - Django string field
    'boolean': fields.BooleanField,
+
* boolean - Django boolean field
    'clusterip': fields.ClusterIPField,
+
* text - Django boolean field
    'domain': fields.DomainChoiceField,
+
* integer - Django integer field
    'password': fields.PasswordField,
+
* password - Specific field with validation for strong password
    'integer': fields.IntegerField,
+
* clusterip - Specific field, used for cluster IP
    'databaselist': fields.DatabaseListField,
+
* floatingip - Specific field, used for enabling Floating IP during deployment
    'table': fields.TableField,
+
* domain - Specific field, used for Active Directory domain
    'flavor': fields.FlavorChoiceField,
+
* databaselist - Specific field, list of databases (comma-separated list of database names, where each name has the following syntax: first symbol should be latin letter or underscore; subsequent symbols can be Latin letter, numeric, underscore, at the sign, number sign or dollar sign)
    'keypair': fields.KeyPairChoiceField,
+
* table - Specific field, used for defining table in a form
    'image': fields.ImageChoiceField,
+
* flavor - Specific field, used for defining flavor in a form
    'azone': fields.AZoneChoiceField,
+
* keypair - Specific field, used for defining KeyPair in a form
    'text': (fields.CharField, forms.Textarea),
+
* image- Specific field, used for defining image in a form
    'floatingip': fields.FloatingIpBooleanField,
+
* azone - Specific field, used for defining availability zone in a form
    'psqlDatabase'
+
* psqlDatabase -Specific field, used for browsing deployed  PostgreSQL databases

Revision as of 08:00, 11 April 2014

Dynamic UI Definition Manual

The main purpose of Dynamic UI is to generate application creation forms "on-the-fly". Murano dashboard doesn't know anything about what applications can be deployed and witch web form need to be used to create application instance. So all application definitions should contain a yaml file which will tell dashboard now to create an application and what validation to be applied. This document will help you to compose a valid UI definition to your application.

Structure

UI definition should be a valid yaml file and should contain the following sections (for version 2):

  • Version - points out to which syntax version is used
  • Templates - auxiliary section, using together with an Application section
  • Application - object model description which will be used in application deployment
  • Forms - web form definitions

Version

Version of supported dynamic UI syntax

Application and Templates

In the Application section "application object model" is described. This model will be translated into json and according to that json application will be deployed. Application section should contain all necessary keys that required for murano-engine to deploy an application. Note that under ? section goes system part of the model.

You can pick parameters you got from the user (they should be described in the Forms section) and pick the right place where they should be set. To do this YAQL is used: 
  • way of setting variables ($ as the first symbol)
  • repeat function
  • interpolate functions

Example: Application: ?:

 type: com.mirantis.murano.services.windows.activeDirectory.ActiveDirectory
 name: $.serviceConfiguration.name
 primaryController:
    ?:
        type: com.mirantis.murano.services.windows.activeDirectory.PrimaryController
        host: $host
        secondaryControllers: repeat($secondaryController, 2, $.serviceConfiguration.dcInstances + 1)

Forms

This section describes Django forms. Set name for your form and provide fields and validators. Each field should contain:

  • name
  • type
  • label
  • description.

Supported field types, which support build-in validation:

  • string - Django string field
  • boolean - Django boolean field
  • text - Django boolean field
  • integer - Django integer field
  • password - Specific field with validation for strong password
  • clusterip - Specific field, used for cluster IP
  • floatingip - Specific field, used for enabling Floating IP during deployment
  • domain - Specific field, used for Active Directory domain
  • databaselist - Specific field, list of databases (comma-separated list of database names, where each name has the following syntax: first symbol should be latin letter or underscore; subsequent symbols can be Latin letter, numeric, underscore, at the sign, number sign or dollar sign)
  • table - Specific field, used for defining table in a form
  • flavor - Specific field, used for defining flavor in a form
  • keypair - Specific field, used for defining KeyPair in a form
  • image- Specific field, used for defining image in a form
  • azone - Specific field, used for defining availability zone in a form
  • psqlDatabase -Specific field, used for browsing deployed PostgreSQL databases