Commit 14cc2c8a authored by Pawel Chojnacki's avatar Pawel Chojnacki

Routes + query

parent 0366660c
...@@ -73,6 +73,10 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -73,6 +73,10 @@ constraints(ProjectUrlConstrainer.new) do
resource :mattermost, only: [:new, :create] resource :mattermost, only: [:new, :create]
namespace :prometheus do namespace :prometheus do
resources :metrics, constraints: { id: /[^\/]+/ }, only: [:index, :show, :edit, :update, :destroy] do
post :validate_query
get :active
end
get :active_metrics get :active_metrics
end end
......
module Gitlab
module Prometheus
class Query
include ActiveModel::Model
include ActiveRecord::Base
attr_accessor :unit, :series_dsl, :label, :type, track: canary
validates :title, :required_metrics, :weight, :y_label, :queries, presence: true
def initialize(params = {})
super(params)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment