metrics

package
v0.0.0-...-f5426d5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 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 ArchivePolicy

type ArchivePolicy struct {
	Definition         []Granularity `json:"definition"`
	BackWindow         int           `json:"back_window"`
	Name               string        `json:"name"`
	AggregationMethods []string      `json:"aggregation_methods"`
}

type CreateMetric

type CreateMetric struct {
	ArchivePolicyName  string `mapstructure:"archive_policy_name"`
	CreatedByProjectID string `mapstructure:"created_by_project_id"`
	CreatedByUserID    string `mapstructure:"created_by_user_id"`
	Creator            string `json:"creator"`
	ID                 string `json:"id"`
	Name               string `json:"name"`
	ResourceID         string `mapstructure:"resource_id"`
	Unit               string `json:"unit"`
}

type CreateOpts

type CreateOpts struct {
	ArchivePolicyName string `json:"archive_policy_name" required:"true"`
}

func (CreateOpts) ToMetricCreateMap

func (opts CreateOpts) ToMetricCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToMetricCreateMap() (string, error)
}

type CreateResult

type CreateResult struct {
	gophercloud.Result
}

func Create

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

func (CreateResult) Extract

func (r CreateResult) Extract() (*CreateResult, error)

Extract interprets any CreateResult as an array of CreateMetric

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

func Delete

func Delete(client *gophercloud.ServiceClient, metricID string) (r DeleteResult)

Metrics can be deleted through a request

type Granularity

type Granularity struct {
	Points      int    `json:"points"`
	Timespan    string `json:"timespan"`
	Granularity string `json:"granularity"`
}

type ListOpts

type ListOpts struct {

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

	// 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) ToMetricListQuery

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

ToMetricListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToMetricListQuery() (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 metrics accessible to you.

func (ListResult) Extract

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

Extract interprets any ListResult as an array of Metrics

type Metric

type Metric struct {
	CreatedByUserID    string        `mapstructure:"created_by_user_id"`
	Name               string        `json:"name"`
	Creator            string        `json:"creator"`
	ResourceID         string        `mapstructure:"resource_id"`
	CreatedByProjectID string        `mapstructure:"created_by_project_id"`
	ArchivePolicy      ArchivePolicy `mapstructure:"archive_policy"`
	ID                 string        `json:"id"`
	Unit               string        `json:"unit"`
}

type ReadResult

type ReadResult struct {
	gophercloud.Result
}

func Read

func Read(client *gophercloud.ServiceClient, metricID string) ReadResult

Read makes request against the API to Read metric

func (ReadResult) Extract

func (r ReadResult) Extract() (Metric, error)

Extract interprets any ReadResult as an array of Metric

Jump to

Keyboard shortcuts

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