Nested Service Dialogs


#1

Is there a good way to do an “include” within a yml service dialog? I want to create service dialogs as YML but I don’t want to duplicate myself.


#2

Can you be a little more specific? Please describe what you are trying to accomplish.


#3

I found a YML based solution using the YAML merge ideas. Basically I don’t want to repeat code so I want to write some generic “all server” service dialog fields and then some more specific “linux” and “windows” ones. I want to include the all server YML with both the linux and windows without putting them in both YML service dialog files.


#4

That sounds cool. Unfortunately I don’t think it will work inside of MIQ. Each dialog is a seperate record in the database and I can’t see how you could join them in the UI.

One thing you could do is create a single YAML that has your base information then add your sections in prior to imported the dialog.

HTH


#5

Ramrexx –

Yes that is basically what I have done using the YML Merge functionallity. http://yaml.org/type/merge.html

I’ve built a template that contains all my tabs and boxes as & merge variables and then including them with the * stuff in the template I want them in. Its all in one single YML file.


#6

Can you share what you have? I would love to see what you have come up with.


#7

For sure - I’m excited to find ways to contribute back to everyone here.

---
- description: _template-tabs
  buttons: submit,cancel
  label: _template-tabs
  blueprint_id: 
  dialog_tabs:
  - description: VM Configuration
    display: edit
    label: VM Configuration
    display_method: 
    display_method_options: 
    position: 0
    dialog_groups:
    - &box_vmconfiguration
      description: 
      display: edit
      label: Configuration
      display_method: 
      display_method_options: 
      position: 0
      dialog_fields:
      - name: num_machines
        description: Number of VMs
        data_type: int
        notes: 
        notes_display: 
        display: edit
        display_method: 
        display_method_options: {}
        required: false
        required_method: 
        required_method_options: {}
        default_value: ''
        values: 
        values_method: 
        values_method_options: {}
        options:
          :protected: false
        label: Number of VMs
        position: 0
        validator_type: 
        validator_rule: 
        reconfigurable: 
        dynamic: false
        show_refresh_button: 
        load_values_on_init: 
        read_only: false
        auto_refresh: 
        trigger_auto_refresh: 
        visible: true
        type: DialogFieldTextBox
        resource_action:
          action: 
          resource_type: DialogField
          ae_namespace: 
          ae_class: 
          ae_instance: 
          ae_message: 
          ae_attributes: {}
      - name: vm_size
        description: Size of Virtual Machine
        data_type: string
        notes: 
        notes_display: 
        display: edit
        display_method: 
        display_method_options: {}
        required: true
        required_method: 
        required_method_options: {}
        default_value: small
        values:
        - - large
          - Large
        - - medium
          - Medium
        - - small
          - Small
        values_method: 
        values_method_options: {}
        options:
          :sort_by: :description
          :sort_order: :ascending
        label: VM Size
        position: 1
        validator_type: 
        validator_rule: 
        reconfigurable: 
        dynamic: false
        show_refresh_button: 
        load_values_on_init: 
        read_only: false
        auto_refresh: 
        trigger_auto_refresh: 
        visible: true
        type: DialogFieldDropDownList
        resource_action:
          action: 
          resource_type: DialogField
          ae_namespace: 
          ae_class: 
          ae_instance: 
          ae_message: 
          ae_attributes: {}
    - &box_linuxconfiguration
      description: Linux Configuration
      display: edit
      label: Linux Configuration
      display_method: 
      display_method_options: 
      position: 1
      dialog_fields:
      - name: os_version
        description: OS Version
        data_type: string
        notes: 
        notes_display: 
        display: edit
        display_method: 
        display_method_options: {}
        required: true
        required_method: 
        required_method_options: {}
        default_value: CentOS 7
        values:
        - - CentOS 7
          - CentOS 7
        - - Redhat 6
          - Redhat 6
        - - Redhat 7
          - Redhat 7
        values_method: 
        values_method_options: {}
        options:
          :sort_by: :description
          :sort_order: :ascending
        label: OS Version
        position: 0
        validator_type: 
        validator_rule: 
        reconfigurable: 
        dynamic: false
        show_refresh_button: 
        load_values_on_init: 
        read_only: false
        auto_refresh: 
        trigger_auto_refresh: 
        visible: true
        type: DialogFieldDropDownList
        resource_action:
          action: 
          resource_type: DialogField
          ae_namespace: 
          ae_class: 
          ae_instance: 
          ae_message: 
          ae_attributes: {}
    - &box_windowsconfiguration
      description: Windows Configuration
      display: edit
      label: Windows Configuration
      display_method: 
      display_method_options: 
      position: 2
      dialog_fields:
      - name: os_version
        description: OS Version
        data_type: string
        notes: 
        notes_display: 
        display: edit
        display_method: 
        display_method_options: {}
        required: true
        required_method: 
        required_method_options: {}
        default_value: 
        values:
        - - Windows 2012
          - Windows 2012
        - - Windows 2016
          - Windows 2016
        values_method: 
        values_method_options: {}
        options:
          :sort_by: :description
          :sort_order: :ascending
        label: OS Version
        position: 0
        validator_type: 
        validator_rule: 
        reconfigurable: 
        dynamic: false
        show_refresh_button: 
        load_values_on_init: 
        read_only: false
        auto_refresh: 
        trigger_auto_refresh: 
        visible: true
        type: DialogFieldDropDownList
        resource_action:
          action: 
          resource_type: DialogField
          ae_namespace: 
          ae_class: 
          ae_instance: 
          ae_message: 
          ae_attributes: {}
  - &tab_linuxvm
    description: Linux Virtual Machine
    display: edit
    label: Linux Virtual Machine
    display_method:
    display_method_options:
    position: 1
    dialog_groups: [*box_vmconfiguration,*box_linuxconfiguration]
  - &tab_windowsvm
    description: Windows Virtual Machine
    display: edit
    label: Windows Virtual Machine
    display_method:
    display_method_options:
    position: 1
    dialog_groups: [*box_vmconfiguration,*box_windowsconfiguration]
  - &tab_postgresql
    description: PostgreSQL
    display: edit
    label: PostgreSQL
    display_method: 
    display_method_options: 
    position: 2
    dialog_groups:
    - description: Configuration
      display: edit
      label: Configuration
      display_method: 
      display_method_options: 
      position: 0
      dialog_fields:
      - name: Version
        description: PostgreSQL Version
        data_type: 
        notes: 
        notes_display: 
        display: edit
        display_method: 
        display_method_options: {}
        required: false
        required_method: 
        required_method_options: {}
        default_value: ''
        values: 
        values_method: 
        values_method_options: {}
        options:
          :protected: false
        label: Version
        position: 0
        validator_type: 
        validator_rule: 
        reconfigurable: 
        dynamic: false
        show_refresh_button: 
        load_values_on_init: 
        read_only: false
        auto_refresh: 
        trigger_auto_refresh: 
        visible: true
        type: DialogFieldTextBox
        resource_action:
          action: 
          resource_type: DialogField
          ae_namespace: 
          ae_class: 
          ae_instance: 
          ae_message: 
          ae_attributes: {}