usage

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 19 Imported by: 2

README

sacloud-usage-lib

Documentation

Index

Constants

View Source
const (
	ExitOk       = 0
	ExitWarning  = 1
	ExitCritical = 2
	ExitUnknown  = 3
)

Variables

View Source
var Version = "0.0.7"

Version app version

Functions

func OutputMetrics

func OutputMetrics(w io.Writer, metrics map[string]interface{}, query string) error

func ParseOption

func ParseOption(o interface{}) error

func PrintVersion

func PrintVersion(appVersion string)

func SacloudAPICaller added in v0.0.4

func SacloudAPICaller(productName, version string) (iaas.APICaller, error)

Types

type MonitorValue

type MonitorValue struct {
	Time  time.Time
	Value float64
}

type Option

type Option struct {
	Time          uint     `long:"time" description:"Get average traffic for a specified amount of time" default:"3"`
	Prefix        []string `long:"prefix" description:"prefix for router names. prefix accepts more than one." required:"true"`
	Zones         []string `long:"zone" description:"zone name" required:"true"`
	PercentileSet string   `long:"percentile-set" default:"99,95,90,75" description:"percentiles to dispaly"`
	Version       bool     `short:"v" long:"version" description:"Show version"`
	Query         string   `long:"query" description:"jq style query to result and display"`
	EnvFrom       string   `long:"env-from" description:"load environment values from this file"`
	// contains filtered or unexported fields
}

type Resource

type Resource struct {
	ID   types.ID
	Name string
	Zone string

	Monitors []MonitorValue
	Label    string

	AdditionalInfo map[string]interface{}
}

type Resources

type Resources struct {
	Resources []*Resource
	Label     string
	Option    *Option
}

func (*Resources) Metrics

func (rs *Resources) Metrics() map[string]interface{}

Jump to

Keyboard shortcuts

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