vultr

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SDCheckInterval = flag.Duration("promscrape.vultrSDCheckInterval", 30*time.Second, "Interval for checking for changes in Vultr. "+
	"This works only if vultr_sd_configs is configured in '-promscrape.config' file. "+
	"See https://docs.victoriametrics.com/sd_configs.html#vultr_sd_configs for details")

SDCheckInterval defines interval for Vultr targets refresh.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	ID               string   `json:"id"`
	OS               string   `json:"os"`
	RAM              int      `json:"ram"`
	Disk             int      `json:"disk"`
	MainIP           string   `json:"main_ip"`
	VCPUCount        int      `json:"vcpu_count"`
	Region           string   `json:"region"`
	ServerStatus     string   `json:"server_status"`
	AllowedBandwidth int      `json:"allowed_bandwidth"`
	V6MainIP         string   `json:"v6_main_ip"`
	Hostname         string   `json:"hostname"`
	Label            string   `json:"label"`
	InternalIP       string   `json:"internal_ip"`
	OSID             int      `json:"os_id"`
	Features         []string `json:"features"`
	Plan             string   `json:"plan"`
	Tags             []string `json:"tags"`
}

Instance represents Vultr Instance (VPS).

See: https://github.com/vultr/govultr/blob/5125e02e715ae6eb3ce854f0e7116c7ce545a710/instance.go#L81

type Links struct {
	Next string `json:"next"`
}

Links represent the next/previous cursor in your pagination calls

type ListInstanceResponse

type ListInstanceResponse struct {
	Instances []Instance `json:"instances"`
	Meta      Meta       `json:"meta"`
}

ListInstanceResponse is the response structure of Vultr ListInstance API.

type Meta

type Meta struct {
	Links Links `json:"links"`
}

Meta represents the available pagination information

See https://www.vultr.com/api/#section/Introduction/Meta-and-Pagination

type SDConfig

type SDConfig struct {
	// API query params for filtering. All of them are optional.
	// See: https://www.vultr.com/api/#tag/instances/operation/list-instances
	Label           string `yaml:"label,omitempty"`
	MainIP          string `yaml:"main_ip,omitempty"`
	Region          string `yaml:"region,omitempty"`
	FirewallGroupID string `yaml:"firewall_group_id,omitempty"`
	Hostname        string `yaml:"hostname,omitempty"`

	// The port to scrape metrics from. Default 80.
	Port int `yaml:"port"`

	// General HTTP / Auth configs.
	HTTPClientConfig  promauth.HTTPClientConfig  `yaml:",inline"`
	ProxyURL          *proxy.URL                 `yaml:"proxy_url,omitempty"`
	ProxyClientConfig promauth.ProxyClientConfig `yaml:",inline"`
}

SDConfig represents service discovery config for Vultr.

See: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#vultr_sd_config Additional query params are supported, while Prometheus only supports `Port` and HTTP auth.

func (*SDConfig) GetLabels

func (sdc *SDConfig) GetLabels(baseDir string) ([]*promutils.Labels, error)

GetLabels returns gce labels according to sdc.

func (*SDConfig) MustStop

func (sdc *SDConfig) MustStop()

MustStop stops further usage for sdc.

Jump to

Keyboard shortcuts

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