diff options
Diffstat (limited to 'spec/fixtures/lib/gitlab/metrics/dashboard')
8 files changed, 82 insertions, 2 deletions
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/sample_dashboard.yml b/spec/fixtures/lib/gitlab/metrics/dashboard/sample_dashboard.yml index 5177de66fcf..1e41ef669d1 100644 --- a/spec/fixtures/lib/gitlab/metrics/dashboard/sample_dashboard.yml +++ b/spec/fixtures/lib/gitlab/metrics/dashboard/sample_dashboard.yml @@ -13,6 +13,23 @@ templating: options: default_value: 'default' text_variable_simple_syntax: 'default value' + custom_variable_simple_syntax: ['value1', 'value2', 'value3'] + custom_variable_full_syntax: + label: 'Variable 2' + type: custom + options: + values: + - value: 'value option 1' + text: 'Option 1' + - value: 'value_option_2' + text: 'Option 2' + default: true + metric_label_values_variable: + label: 'Variable 3' + type: metric_label_values + options: + series_selector: 'backend:haproxy_backend_availability:ratio{env="{{env}}"}' + label: 'backend' panel_groups: - group: Group A priority: 1 diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/custom_variable_full_syntax.json b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/custom_variable_full_syntax.json new file mode 100644 index 00000000000..e251e59de29 --- /dev/null +++ b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/custom_variable_full_syntax.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "required": [ + "type", "options" + ], + "properties": { + "type": { "enum": ["custom"] }, + "label": { "type": "string" }, + "options": { "$ref": "custom_variable_options.json" } + }, + "additionalProperties": false +} diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/custom_variable_options.json b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/custom_variable_options.json new file mode 100644 index 00000000000..f351d3ba340 --- /dev/null +++ b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/custom_variable_options.json @@ -0,0 +1,11 @@ +{ + "type": "object", + "required": ["values"], + "properties": { + "values": { + "type": "array", + "items": { "$ref": "custom_variable_values.json" } + } + }, + "additionalProperties": false +} diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/custom_variable_values.json b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/custom_variable_values.json new file mode 100644 index 00000000000..430d66a9691 --- /dev/null +++ b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/custom_variable_values.json @@ -0,0 +1,10 @@ +{ + "type": "object", + "required": ["value"], + "properties": { + "value": { "type": "string" }, + "text": { "type": "string" }, + "default": { "type": "boolean" } + }, + "additionalProperties": false +} diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/metric_label_values_variable_full_syntax.json b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/metric_label_values_variable_full_syntax.json new file mode 100644 index 00000000000..6eb2c0e51e2 --- /dev/null +++ b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/metric_label_values_variable_full_syntax.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "required": [ + "type", "options" + ], + "properties": { + "type": { "enum": "metric_label_values" }, + "label": { "type": "string" }, + "options": { "$ref": "metric_label_values_variable_options.json" } + }, + "additionalProperties": false +} diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/metric_label_values_variable_options.json b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/metric_label_values_variable_options.json new file mode 100644 index 00000000000..304372ed876 --- /dev/null +++ b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/metric_label_values_variable_options.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "required": [ + "series_selector", "label", "prometheus_endpoint_path" + ], + "properties": { + "series_selector": { "type": "string" }, + "label": { "type": "string" }, + "prometheus_endpoint_path": { "type": "string" } + }, + "additionalProperties": false +} diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/text_variable_full_syntax.json b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/text_variable_full_syntax.json index f5090dc8c88..1818b2775f0 100644 --- a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/text_variable_full_syntax.json +++ b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/text_variable_full_syntax.json @@ -4,7 +4,7 @@ "type", "options" ], "properties": { - "type": { "type": "string" }, + "type": { "enum": ["text"] }, "label": { "type": "string" }, "options": { "$ref": "text_variable_options.json" } }, diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/variables.json b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/variables.json index f3e0dd555a6..aec129111e0 100644 --- a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/variables.json +++ b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/variables.json @@ -4,7 +4,13 @@ "^[a-zA-Z0-9_]*$": { "anyOf": [ { "$ref": "text_variable_full_syntax.json" }, - { "type": "string" } + { "type": "string" }, + { + "type": "array", + "items": { "type": "string" } + }, + { "$ref": "custom_variable_full_syntax.json" }, + { "$ref": "metric_label_values_variable_full_syntax.json" } ] } }, |