managed

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2018 License: AGPL-3.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ErrCanceled           = 1
	ErrUnknown            = 2
	ErrInvalidArgument    = 3
	ErrDeadlineExceeded   = 4
	ErrNotFound           = 5
	ErrAlreadyExists      = 6
	ErrPermissionDenied   = 7
	ErrUnauthenticated    = 16
	ErrResourceExhausted  = 8
	ErrFailedPrecondition = 9
	ErrAborted            = 10
	ErrOutOfRange         = 11
	ErrUnimplemented      = 12
	ErrInternal           = 13
	ErrUnavailable        = 14
	ErrDataLoss           = 15
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIBasicAuth

type APIBasicAuth struct {
	// username
	Username string `json:"username,omitempty"`

	// password
	Password string `json:"password,omitempty"`
}

type APILabelPair

type APILabelPair struct {
	// Label name
	Name string `json:"name,omitempty"`

	// Label value
	Value string `json:"value,omitempty"`
}

type APIScrapeConfig

type APIScrapeConfig struct {
	// The job name assigned to scraped metrics by default: "example-job" (required)
	JobName string `json:"job_name,omitempty"`

	// How frequently to scrape targets from this job: "10s"
	ScrapeInterval string `json:"scrape_interval,omitempty"`

	// Per-scrape timeout when scraping this job: "5s"
	ScrapeTimeout string `json:"scrape_timeout,omitempty"`

	// The HTTP resource path on which to fetch metrics from targets: "/metrics"
	MetricsPath string `json:"metrics_path,omitempty"`

	// Configures the protocol scheme used for requests: "http" or "https"
	Scheme string `json:"scheme,omitempty"`

	// Sets the `Authorization` header on every scrape request with the configured username and password
	BasicAuth *APIBasicAuth `json:"basic_auth,omitempty"`

	// Configures the scrape request's TLS settings
	TLSConfig *APITLSConfig `json:"tls_config,omitempty"`

	// List of labeled statically configured targets for this job
	StaticConfigs []*APIStaticConfig `json:"static_configs"`
}

type APIScrapeConfigsCreateRequest

type APIScrapeConfigsCreateRequest struct {
	// scrape config
	ScrapeConfig *APIScrapeConfig `json:"scrape_config,omitempty"`

	// Check that added targets can be scraped from PMM Server
	CheckReachability bool `json:"check_reachability,omitempty"`
}

type APIScrapeConfigsGetResponse added in v1.7.0

type APIScrapeConfigsGetResponse struct {
	// scrape config
	ScrapeConfig *APIScrapeConfig `json:"scrape_config,omitempty"`

	// Scrape targets health for this scrape job
	ScrapeTargetsHealth []*APIScrapeTargetHealth `json:"scrape_targets_health"`
}

type APIScrapeConfigsListResponse

type APIScrapeConfigsListResponse struct {
	// scrape configs
	ScrapeConfigs []*APIScrapeConfig `json:"scrape_configs"`

	// Scrape targets health for all managed scrape jobs
	ScrapeTargetsHealth []*APIScrapeTargetHealth `json:"scrape_targets_health"`
}

type APIScrapeConfigsUpdateRequest added in v1.7.0

type APIScrapeConfigsUpdateRequest struct {
	// scrape config
	ScrapeConfig *APIScrapeConfig `json:"scrape_config,omitempty"`

	// Check that added targets can be scraped from PMM Server
	CheckReachability bool `json:"check_reachability,omitempty"`
}

type APIScrapeTargetHealth added in v1.7.0

type APIScrapeTargetHealth struct {
	// Original scrape job name
	JobName string `json:"job_name,omitempty"`

	// "job" label value, may be different from job_name due to relabeling
	Job string `json:"job,omitempty"`

	// Original target
	Target string `json:"target,omitempty"`

	// "instance" label value, may be different from target due to relabeling
	Instance string `json:"instance,omitempty"`

	// health
	Health ScrapeTargetHealthHealth `json:"health,omitempty"`
}

type APIStaticConfig

type APIStaticConfig struct {
	// Labels assigned to all metrics scraped from the targets
	Labels []*APILabelPair `json:"labels"`

	// Hostnames or IPs followed by an optional port number: "1.2.3.4:9090"
	Targets []string `json:"targets"`
}

type APITLSConfig

type APITLSConfig struct {
	// insecure skip verify
	InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"`
}

type Client

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

func NewClient

func NewClient(host string, scheme string, user *url.Userinfo, insecureSSL bool, verbose bool) *Client

func (*Client) ScrapeConfigsCreate

func (c *Client) ScrapeConfigsCreate(ctx context.Context, req *APIScrapeConfigsCreateRequest) error

func (*Client) ScrapeConfigsDelete

func (c *Client) ScrapeConfigsDelete(ctx context.Context, jobName string) error

func (*Client) ScrapeConfigsGet added in v1.7.0

func (c *Client) ScrapeConfigsGet(ctx context.Context, jobName string) (*APIScrapeConfigsGetResponse, error)

func (*Client) ScrapeConfigsList

func (c *Client) ScrapeConfigsList(ctx context.Context) (*APIScrapeConfigsListResponse, error)

func (*Client) ScrapeConfigsUpdate added in v1.7.0

func (c *Client) ScrapeConfigsUpdate(ctx context.Context, req *APIScrapeConfigsUpdateRequest) error

type Error

type Error struct {
	Err  string `json:"error"`
	Code int    `json:"code"`
}

func (*Error) Error

func (e *Error) Error() string

type ScrapeTargetHealthHealth added in v1.7.0

type ScrapeTargetHealthHealth string
const (
	// ScrapeTargetHealthHealthUNKNOWN captures enum value "UNKNOWN"
	ScrapeTargetHealthHealthUNKNOWN ScrapeTargetHealthHealth = "UNKNOWN"
	// ScrapeTargetHealthHealthDOWN captures enum value "DOWN"
	ScrapeTargetHealthHealthDOWN ScrapeTargetHealthHealth = "DOWN"
	// ScrapeTargetHealthHealthUP captures enum value "UP"
	ScrapeTargetHealthHealthUP ScrapeTargetHealthHealth = "UP"
)

Jump to

Keyboard shortcuts

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