2013-02-22 12:07:35 -08:00
|
|
|
// Copyright 2013 Prometheus Team
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2013-01-10 17:27:03 -08:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
2013-01-12 12:22:59 -08:00
|
|
|
"code.google.com/p/gorest"
|
2013-05-05 10:32:04 -07:00
|
|
|
"github.com/prometheus/prometheus/config"
|
|
|
|
"github.com/prometheus/prometheus/retrieval"
|
|
|
|
"github.com/prometheus/prometheus/storage/metric"
|
2013-01-27 10:59:20 -08:00
|
|
|
"github.com/prometheus/prometheus/utility"
|
2013-01-10 17:27:03 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
type MetricsService struct {
|
2013-01-12 12:22:59 -08:00
|
|
|
gorest.RestService `root:"/api/" consumes:"application/json" produces:"application/json"`
|
2013-01-10 17:27:03 -08:00
|
|
|
|
2013-07-23 17:18:49 -07:00
|
|
|
query gorest.EndPoint `method:"GET" path:"/query?{expr:string}&{as_text:string}" output:"string"`
|
2013-01-15 02:30:55 -08:00
|
|
|
queryRange gorest.EndPoint `method:"GET" path:"/query_range?{expr:string}&{end:int64}&{range:int64}&{step:int64}" output:"string"`
|
2013-02-06 08:08:05 -08:00
|
|
|
metrics gorest.EndPoint `method:"GET" path:"/metrics" output:"string"`
|
|
|
|
|
2013-02-22 12:07:35 -08:00
|
|
|
setTargets gorest.EndPoint `method:"PUT" path:"/jobs/{jobName:string}/targets" postdata:"[]TargetGroup"`
|
2013-05-05 10:32:04 -07:00
|
|
|
time utility.Time
|
2013-02-22 12:07:35 -08:00
|
|
|
|
2013-05-05 10:32:04 -07:00
|
|
|
Config *config.Config
|
|
|
|
TargetManager retrieval.TargetManager
|
|
|
|
Storage *metric.TieredStorage
|
2013-01-10 17:27:03 -08:00
|
|
|
}
|