VK Cloud logo

display.yaml fileBeta

The display.yaml configuration file describes how the tariff plan will be displayed in the tariff plan matrix of your application.

Main sections of the file:

Name

Description

Format

Required

pages

Describes all pages of the tariff plan configuration wizard, except the first and last ones.

If the parameter is not specified, the configuration wizard will consist only of automatically generated pages

Array

display.yaml file

entities

Describes the billable VK Cloud infrastructure items:

  • VMs;
  • load balancers;
  • external IP addresses.

The cost of these items will be displayed in the tariff plan configuration wizard. It is calculated automatically in accordance with VK Cloud tariffs

Array

display.yaml file

pages array

The array describes the pages of the configuration wizard for the tariff plan. Each page displays one or more groups of tariff options. The maximum number of pages is 5.

Parameters of the pages array:

Name

Description

Format

Required

name

Name of the configuration wizard page, no more than 32 characters

string

display.yaml file

groups

Groups of tariff options displayed on a specific page of the configuration wizard

Array

display.yaml file

groups.name

Name of the tariff option group, no more than 255 characters

string

display.yaml file

groups.parameters

List of names of the tariff options included in the group.

List, list item — string

display.yaml file

groups.parameters.name

Name of the tariff option, matching the name of the YAML file of this option: <OPTION_NAME>.

string

display.yaml file

By default, the tariff plan configuration wizard displays all groups of tariff options (groups) specified in the pages array. The when construct is used to show or hide groups depending on specified conditions.

Below is an example of how the tariff plan configuration wizard from this example will be displayed.

pic1

entities array

The array describes the elements of the VK Cloud infrastructure that will be billed under the tariff plan.

By default, the tariff plan configuration wizard displays the cost of all infrastructure elements described in the entities array. The when construct is used to show or hide the infrastructure cost depending on specified conditions.

General parameters of the entities array:

Name

Description

Format

Required

entity

Type of infrastructure element:

  • vm — VM.
  • load_balancing — load balancer.
  • floating_ip — external IP address.

string

display.yaml file

description

Description of the infrastructure element

string

display.yaml file

Example of describing the Service settings page in the tariff plan configuration wizard:

pages:- name: Service settings # Page name  groups:  - name: Server # Tariff option group name    parameters:    - name: network # Tariff option name    - name: vm    - name: az  - name: System disk    parameters:    - name: volume_size    - name: volume_type

VM

Parameters of the entities array for a VM:

Name

Description

Format

Required

count

Number of VMs, specified by the const or param parameter

Section

display.yaml file

count.const

Number of VMs

integer

—

count.param

Name of the tariff option (<OPTION_NAME>) whose value determines the number of VMs

string

—

flavor

VM type, specified by the const or param parameter

Section

display.yaml file

flavor.const

VM configuration template ID

string

—

flavor.param

Name of the tariff option (<OPTION_NAME>) describing the VM type: datasource.type = flavor

string

—

disks

VM disks. Each disk is described by the type and size sections

Array

display.yaml file, if the pages array specifies an option of type datasource.type = volume_type

disks.type

Disk type, specified by the const or param parameter

Section

—

disks.type.const

Disk type.

Possible values:

  • ceph-ssd — SSD disk.
  • ceph-hdd — HDD disk.
  • high-iops — High-IOPS SSD disk (SSD with increased performance).

string

—

disks.type.param

Name of the tariff option (<OPTION_NAME>) describing the disk type: datasource.type = volume_type

string

—

disks.size

Disk size, specified by the const or param parameter

Section

—

disks.size.const

Disk size

integer

—

disks.size.param

Name of the tariff option (<OPTION_NAME>) whose value determines the disk size

string

—

Example of describing a VM for the tariff plan configuration wizard:

entities:  - entity: vm    description: Virtual machine    count:      const: 1    flavor:      param: ds-flavor # Tariff option name    disks:      - type:          param: root_type        size:          param: root_size      - type:          param: data_type        size:          param: data_size

Below is an example of how the infrastructure cost information from this example will be displayed in the tariff plan configuration wizard.

pic1

Load balancer

Parameters of the entities array for a load balancer:

Name

Description

Format

Required

count

Number of load balancers, specified by the const or param parameter

Section

display.yaml file

count.const

Number of load balancers

integer

—

count.param

Name of the tariff option (<OPTION_NAME>) whose value determines the number of load balancers

string

—

Example of describing a load balancer for the tariff plan configuration wizard:

entities:  - entity: load_balancing    count:      param: number_balancing # Tariff option name

External IP address

Parameters of the entities array for an external IP address:

Name

Description

Format

Required

count

Number of external IP addresses, specified by the const or param parameter

Section

display.yaml file

count.const

Number of external IP addresses

integer

—

count.param

Name of the tariff option (<OPTION_NAME>) whose value determines the number of external IP addresses

string

—

Example of describing an external IP address for the tariff plan configuration wizard:

entities:  - entity: floating_ip    count:      const: 1

when construct

The when construct controls conditional branching when displaying the tariff plan wizard. It contains:

  • Condition type:

    • when.in — checks equality of the values specified by the key and values parameters. The condition is met if the value of key is equal to at least one of the values.
    • when.not_in — checks inequality of the values specified by the key and values parameters. The condition is met if the value of key is not equal to any of the values.
  • Criteria. Specified by the key and values parameters in one of the following ways:

    • Via the param parameter — to use the value of a specific tariff option.
    • Via the const parameter — to use a fixed value.

    key can be set to one value, values — to one or more.

Structure of when in YAML format:

when:  in: # or not_in    key:      param: <OPTION_NAME> # or const: <VALUE>    values:      - const: <VALUE>      - param: <OPTION_NAME>      ...

Here:

  • <OPTION_NAME> — the name of the tariff option, matching the name of the YAML file of this option.
  • <VALUE> — a fixed value.

when construct in the pages array

In the pages array, the when construct is used to set a condition that determines whether a group of tariff options should be displayed in the tariff plan configuration wizard.

The same tariff option can be used in when constructs in different groups. Depending on the value of the tariff option, different groups will be displayed in the configuration wizard.

When using the when construct, a page with groups of tariff options will be hidden if the following conditions are met at the same time:

  • All groups on the same page have a when construct.
  • The tariff plan configuration wizard has tariff option values set such that the conditions in all groups on this page are not met.

Example of using the when construct in the pages array:

pages:- name: Backup settings # Page name  groups:  - name: High-frequency backup # Tariff option group name    parameters:    - name: frequency_per_day # Tariff option name    when:      in:        key:          param: backup_method # Tariff option name        values:          - const: high-frequency

In this example, the High-frequency backup group with the frequency_per_day tariff option will be displayed if the user selected the value high-frequency for the backup_method tariff option in the configuration wizard. The user will then be able to choose the backup frequency.

The backup_method tariff option:

  • can be used in a when construct in other groups;
  • must be specified in the parameters array in another group.

The frequency_per_day tariff option cannot be used in other groups:

  • in a when construct — because only one level of condition hierarchy is supported;
  • in parameters — because a single tariff option can be specified in only one group.

when construct in the entities array

In the entities array, the when construct is used to set a condition that determines whether the cost of the infrastructure element described in the entities array should be displayed in the tariff plan configuration wizard.

Example of using the when construct in the entities array:

entities:  - entity: vm    description: alkair_software    when:      in:        key:          param: need_install_alkair_software # Tariff option name        values:          - const: true    flavor:      const: 6a7a0690-943a-4921-936e-2849970ccfba # VM type (CPU, RAM). In this example, a VM with 2 CPU and 3 GB RAM    count:      const: 1    disks:      - type:          const: high-iops # Disk type        size:          const: 500 # Disk size

This example shows a configuration for displaying the cost of a VM for the Alkair software. If the user selects the value true for the need_install_alkair_software tariff option, the cost of the VM described in the entities.entity element will be displayed in the tariff plan configuration wizard.

pic1
Was this article helpful?