gophercloud: github.com/rackspace/gophercloud/openstack/telemetry/v2/meters Index | Files

package meters

import "github.com/rackspace/gophercloud/openstack/telemetry/v2/meters"

Index

Package Files

doc.go requests.go results.go urls.go

type ListOpts Uses

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 Uses

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

ToMeterListQuery formats a ListOpts into a query string.

type ListOptsBuilder Uses

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

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

type ListResult Uses

type ListResult struct {
    gophercloud.Result
}

func List Uses

func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) ListResult

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

func (ListResult) Extract Uses

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

Extract interprets any ListResult as an array of Meter

type Meter Uses

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 Uses

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 Uses

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

ToStatisticsQuery formats a StatisticsOpts into a query string.

type MeterStatisticsOptsBuilder Uses

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

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

type OldSample Uses

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 Uses

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 Uses

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

ToMeterShowQuery formats a ShowOpts into a query string.

type ShowOptsBuilder Uses

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

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

type ShowResult Uses

type ShowResult struct {
    gophercloud.Result
}

func Show Uses

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 Uses

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

type Statistics Uses

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 Uses

type StatisticsResult struct {
    gophercloud.Result
}

func MeterStatistics Uses

func MeterStatistics(client *gophercloud.ServiceClient, n string, opts MeterStatisticsOptsBuilder) StatisticsResult

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

func (StatisticsResult) Extract Uses

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

Extract interprets any serverResult as a Server, if possible.

Package meters imports 4 packages (graph). Updated 2016-10-27. Refresh now. Tools for package owners.