api

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package api provides the definition of the agent API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client defines the circonus-agent api client configuration

func New

func New(agentURL string) (*Client, error)

New creates a new circonus-agent api client

func (*Client) Inventory

func (c *Client) Inventory() (*Inventory, error)

Inventory retrieves the active plugin inventory from the agent

func (*Client) Metrics

func (c *Client) Metrics(pluginID string) (*Metrics, error)

Metrics retrieves metrics from one or all plugins NOTE: because the API is using the regular agent URL - the

agent will act as though any other client (e.g. a broker)
were requesting metrics - it will *run* the plugin(s).

func (*Client) Write

func (c *Client) Write(groupID string, metrics *Metrics) error

type Inventory

type Inventory []Plugin

Inventory defines list of active plugins

type Metric

type Metric struct {
	Type  string      `json:"_type"`
	Value interface{} `json:"_value"`
}

Metric defines an individual metric

type Metrics

type Metrics map[string]Metric

Metrics holds host metrics

type Plugin

type Plugin struct {
	ID              string   `json:"id"` // combination of name`instance
	Name            string   `json:"name"`
	Instance        string   `json:"instance"`
	Command         string   `json:"command"`
	Args            []string `json:"args"`
	LastRunStart    string   `json:"last_run_start"`
	LastRunEnd      string   `json:"last_run_end"`
	LastRunDuration string   `json:"last_run_duration"`
	LastError       string   `json:"last_error"`
}

Plugin defines an active plugin

Jump to

Keyboard shortcuts

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