client

package
v0.0.0-...-466c4b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright 2018 The KubeSphere Authors. 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.

Index

Constants

View Source
const (
	DefaultHeapsterScheme  = "http"
	DefaultHeapsterService = "heapster.kube-system.svc.cluster.local" //"heapster"
	DefaultHeapsterPort    = "80"                                     // use the first exposed port on the service
	HeapsterApiPath        = "/api/v1/model"
	HeapsterEndpointUrl    = DefaultHeapsterScheme + "://" + DefaultHeapsterService + ":" + DefaultHeapsterPort + HeapsterApiPath
)
View Source
const (
	DefaultScheme          = "http"
	DefaultPrometheusPort  = "9090"
	PrometheusApiPath      = "/api/v1/"
	DefaultQueryStep       = "10m"
	DefaultQueryTimeout    = "10s"
	RangeQueryType         = "query_range?"
	DefaultQueryType       = "query?"
	PrometheusAPIServerEnv = "PROMETHEUS_API_SERVER"
)

Variables

View Source
var PrometheusAPIServer = "prometheus-k8s.kubesphere-monitoring-system.svc"
View Source
var PrometheusEndpointUrl string

Functions

func GetCAdvisorMetrics

func GetCAdvisorMetrics(nodeAddr string) string

func GetHeapsterMetrics

func GetHeapsterMetrics(url string) string

func GetHeapsterMetricsJson

func GetHeapsterMetricsJson(url string) *jason.Object

Get heapster response in python-like dictionary

func NewDBClient

func NewDBClient() *gorm.DB

func NewK8sClient

func NewK8sClient() *kubernetes.Clientset

func NewSharedDBClient

func NewSharedDBClient() *gorm.DB

func SendMonitoringRequest

func SendMonitoringRequest(queryType string, params string) string

Types

type EtcdClient

type EtcdClient struct {
	// contains filtered or unexported fields
}

func NewEtcdClient

func NewEtcdClient() (*EtcdClient, error)

func (EtcdClient) Close

func (cli EtcdClient) Close()

func (EtcdClient) Get

func (cli EtcdClient) Get(key string) ([]byte, error)

func (EtcdClient) Put

func (cli EtcdClient) Put(key, value string) error

type MonitoringRequestParams

type MonitoringRequestParams struct {
	Params           url.Values
	QueryType        string
	SortMetricName   string
	SortType         string
	PageNum          string
	LimitNum         string
	Tp               string
	MetricsFilter    string
	NodesFilter      string
	WsFilter         string
	NsFilter         string
	PodsFilter       string
	ContainersFilter string
	MetricsName      string
	WorkloadName     string
	WlFilter         string
	NodeId           string
	WsName           string
	NsName           string
	PodName          string
	ContainerName    string
	WorkloadKind     string
}

func ParseMonitoringRequestParams

func ParseMonitoringRequestParams(request *restful.Request) *MonitoringRequestParams

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL