meters

package
v0.0.0-...-2f2c61e Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListOpts

type ListOpts struct {
	QueryField string `q:"q.field"`
	QueryOp    string `q:"q.op"`
	QueryValue string `q:"q.value"`

	// ID of the last-seen item from the previous response
	Marker string `q:"marker"`

	// Optional, maximum number of results to return
	Limit int `q:"limit"`
}

ListOpts allows the filtering and sorting of collections through the API. Filtering is achieved by passing in struct field values that map to the server attributes you want to see returned.

func (ListOpts) ToMeterListQuery

func (opts ListOpts) ToMeterListQuery() (string, error)

ToMeterListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToMeterListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type ListResult

type ListResult struct {
	gophercloud.Result
}

func List

List makes a request against the API to list meters accessible to you.

func (ListResult) Extract

func (r ListResult) Extract() ([]Meter, error)

Extract interprets any ListResult as an array of Meter

type Meter

type Meter struct {
	MeterId    string `mapstructure:"meter_id"`
	Name       string `json:"name"`
	ProjectId  string `mapstructure:"project_id"`
	ResourceId string `mapstructure:"resource_id"`
	Source     string `json:"source"`
	Type       string `json:"type"`
	Unit       string `json:"user"`
	UserId     string `mapstructure:"user_id"`
}

type MeterStatisticsOpts

type MeterStatisticsOpts struct {
	QueryField string `q:"q.field"`
	QueryOp    string `q:"q.op"`
	QueryValue string `q:"q.value"`

	// Optional group by
	GroupBy string `q:"groupby"`

	// Optional number of seconds in a period
	Period int `q:"period"`
}

StatisticsOpts allows the filtering and sorting of collections through the API. Filtering is achieved by passing in struct field values that map to the server attributes you want to see returned.

func (MeterStatisticsOpts) ToMeterStatisticsQuery

func (opts MeterStatisticsOpts) ToMeterStatisticsQuery() (string, error)

ToStatisticsQuery formats a StatisticsOpts into a query string.

type MeterStatisticsOptsBuilder

type MeterStatisticsOptsBuilder interface {
	ToMeterStatisticsQuery() (string, error)
}

StatisticsOptsBuilder allows extensions to add additional parameters to the List request.

type OldSample

type OldSample struct {
	Name             string            `mapstructure:"counter_name"`
	Type             string            `mapstructure:"counter_type"`
	Unit             string            `mapstructure:"counter_unit"`
	Volume           float32           `mapstructure:"counter_volume"`
	MessageId        string            `mapstructure:"message_id"`
	ProjectId        string            `mapstructure:"project_id"`
	RecordedAt       time.Time         `mapstructure:"recorded_at"`
	ResourceId       string            `mapstructure:"resource_id"`
	ResourceMetadata map[string]string `mapstructure:"resource_metadata"`
	Source           string            `mapstructure:"source"`
	Timestamp        time.Time         `mapstructure:"timestamp"`
	UserId           string            `mapstructure:"user_id"`
}

type ShowOpts

type ShowOpts struct {
	QueryField string `q:"q.field"`
	QueryOp    string `q:"q.op"`
	QueryValue string `q:"q.value"`

	// ID of the last-seen item from the previous response
	Marker string `q:"marker"`

	// Optional, maximum number of results to return
	Limit int `q:"limit"`
}

ShowOpts allows the filtering and sorting of collections through the API. Filtering is achieved by passing in struct field values that map to the server attributes you want to see returned.

func (ShowOpts) ToShowQuery

func (opts ShowOpts) ToShowQuery() (string, error)

ToMeterShowQuery formats a ShowOpts into a query string.

type ShowOptsBuilder

type ShowOptsBuilder interface {
	ToShowQuery() (string, error)
}

ShowOptsBuilder allows extensions to add additional parameters to the Show request.

type ShowResult

type ShowResult struct {
	gophercloud.Result
}

func Show

func Show(client *gophercloud.ServiceClient, meterName string, opts ShowOptsBuilder) ShowResult

Show makes a request against the API to show a specific meter

func (ShowResult) Extract

func (r ShowResult) Extract() ([]OldSample, error)

type Statistics

type Statistics struct {
	Avg           float32 `json:"avg"`
	Count         int     `json:"count"`
	Duration      float32 `json:"duration"`
	DurationEnd   string  `mapstructure:"duration_end"`
	DurationStart string  `mapstructure:"duration_start"`
	Max           float32 `json:"max"`
	Min           float32 `json:"min"`
	Period        int     `json:"user_id"`
	PeriodEnd     string  `mapstructure:"period_end"`
	PeriodStart   string  `mapstructure:"period_start"`
	Sum           float32 `json:"sum"`
	Unit          string  `json:"unit"`
}

type StatisticsResult

type StatisticsResult struct {
	gophercloud.Result
}

func MeterStatistics

List makes a request against the API to list meters accessible to you.

func (StatisticsResult) Extract

func (r StatisticsResult) Extract() ([]Statistics, error)

Extract interprets any serverResult as a Server, if possible.

Jump to

Keyboard shortcuts

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