Skip to content

roidelapluie/promclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for promclient

Prometheus is an Open-Source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 0.0.1-undefined
  • Package version: 1.0.0
  • Generator version: 7.20.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://prometheus.io/community/

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import promclient "github.com/roidelapluie/promclient"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value promclient.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), promclient.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value promclient.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), promclient.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using promclient.ContextOperationServerIndices and promclient.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), promclient.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), promclient.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to /api/v1

Class Method HTTP request Description
AdminAPI CleanTombstonesPost Post /admin/tsdb/clean_tombstones Clean tombstones in the TSDB
AdminAPI CleanTombstonesPut Put /admin/tsdb/clean_tombstones Clean tombstones in the TSDB via PUT
AdminAPI DeleteSeriesPost Post /admin/tsdb/delete_series Delete series matching selectors
AdminAPI DeleteSeriesPut Put /admin/tsdb/delete_series Delete series matching selectors via PUT
AdminAPI SnapshotPost Post /admin/tsdb/snapshot Create a snapshot of the TSDB
AdminAPI SnapshotPut Put /admin/tsdb/snapshot Create a snapshot of the TSDB via PUT
AlertsAPI Alertmanagers Get /alertmanagers Get Alertmanager discovery
AlertsAPI Alerts Get /alerts Get active alerts
FeaturesAPI GetFeatures Get /features Get features
LabelsAPI LabelValues Get /label/{name}/values Get label values
LabelsAPI Labels Get /labels Get label names
LabelsAPI LabelsPost Post /labels Get label names
MetadataAPI GetMetadata Get /metadata Get metadata
NotificationsAPI GetNotifications Get /notifications Get notifications
OtlpAPI OtlpWrite Post /otlp/v1/metrics OTLP metrics write endpoint
QueryAPI FormatQuery Get /format_query Format a PromQL query
QueryAPI FormatQueryPost Post /format_query Format a PromQL query
QueryAPI ParseQuery Get /parse_query Parse a PromQL query
QueryAPI ParseQueryPost Post /parse_query Parse a PromQL query
QueryAPI Query Get /query Evaluate an instant query
QueryAPI QueryExemplars Get /query_exemplars Query exemplars
QueryAPI QueryExemplarsPost Post /query_exemplars Query exemplars
QueryAPI QueryPost Post /query Evaluate an instant query
QueryAPI QueryRange Get /query_range Evaluate a range query
QueryAPI QueryRangePost Post /query_range Evaluate a range query
RemoteAPI RemoteRead Post /read Remote read endpoint
RemoteAPI RemoteWrite Post /write Remote write endpoint
RulesAPI Rules Get /rules Get alerting and recording rules
SeriesAPI DeleteSeries Delete /series Delete series
SeriesAPI Series Get /series Find series by label matchers
SeriesAPI SeriesPost Post /series Find series by label matchers
StatusAPI GetStatusBuildinfo Get /status/buildinfo Get status buildinfo
StatusAPI GetStatusConfig Get /status/config Get status config
StatusAPI GetStatusFlags Get /status/flags Get status flags
StatusAPI GetStatusRuntimeinfo Get /status/runtimeinfo Get status runtimeinfo
StatusAPI GetStatusWalreplay Get /status/walreplay Get status walreplay
StatusAPI StatusTsdb Get /status/tsdb Get TSDB status
StatusAPI StatusTsdbBlocks Get /status/tsdb/blocks Get TSDB blocks information
TargetsAPI GetScrapePools Get /scrape_pools Get scrape pools
TargetsAPI GetTargets Get /targets Get targets
TargetsAPI GetTargetsMetadata Get /targets/metadata Get targets metadata
TargetsAPI GetTargetsRelabelSteps Get /targets/relabel_steps Get targets relabel steps

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages