Documentation ¶
Index ¶
- type AutoApprovalQuotaPlugin
- func (p *AutoApprovalQuotaPlugin) CollectMetrics(ch chan<- prometheus.Metric, project core.KeystoneProject, ...) error
- func (p *AutoApprovalQuotaPlugin) DescribeMetrics(ch chan<- *prometheus.Desc)
- func (p *AutoApprovalQuotaPlugin) Init(provider *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) error
- func (p *AutoApprovalQuotaPlugin) PluginTypeID() string
- func (p *AutoApprovalQuotaPlugin) Rates() []limesrates.RateInfo
- func (p *AutoApprovalQuotaPlugin) Resources() []limesresources.ResourceInfo
- func (p *AutoApprovalQuotaPlugin) Scrape(project core.KeystoneProject, allAZs []limes.AvailabilityZone) (result map[limesresources.ResourceName]core.ResourceData, ...)
- func (p *AutoApprovalQuotaPlugin) ScrapeRates(project core.KeystoneProject, prevSerializedState string) (result map[limesrates.RateName]*big.Int, serializedState string, err error)
- func (p *AutoApprovalQuotaPlugin) ServiceInfo(serviceType limes.ServiceType) limes.ServiceInfo
- func (p *AutoApprovalQuotaPlugin) SetQuota(project core.KeystoneProject, quotas map[limesresources.ResourceName]uint64) error
- type GenericQuotaPlugin
- func (p *GenericQuotaPlugin) CollectMetrics(ch chan<- prometheus.Metric, project core.KeystoneProject, ...) error
- func (p *GenericQuotaPlugin) DescribeMetrics(ch chan<- *prometheus.Desc)
- func (p *GenericQuotaPlugin) Init(provider *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) error
- func (p *GenericQuotaPlugin) PluginTypeID() string
- func (p *GenericQuotaPlugin) Rates() []limesrates.RateInfo
- func (p *GenericQuotaPlugin) Resources() []limesresources.ResourceInfo
- func (p *GenericQuotaPlugin) Scrape(project core.KeystoneProject, allAZs []limes.AvailabilityZone) (result map[limesresources.ResourceName]core.ResourceData, ...)
- func (p *GenericQuotaPlugin) ScrapeRates(project core.KeystoneProject, prevSerializedState string) (result map[limesrates.RateName]*big.Int, serializedState string, err error)
- func (p *GenericQuotaPlugin) ServiceInfo(serviceType limes.ServiceType) limes.ServiceInfo
- func (p *GenericQuotaPlugin) SetQuota(project core.KeystoneProject, quotas map[limesresources.ResourceName]uint64) error
- type NoopQuotaPlugin
- func (p *NoopQuotaPlugin) CollectMetrics(ch chan<- prometheus.Metric, project core.KeystoneProject, ...) error
- func (p *NoopQuotaPlugin) DescribeMetrics(ch chan<- *prometheus.Desc)
- func (p *NoopQuotaPlugin) Init(provider *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) error
- func (p *NoopQuotaPlugin) PluginTypeID() string
- func (p *NoopQuotaPlugin) Rates() []limesrates.RateInfo
- func (p *NoopQuotaPlugin) Resources() []limesresources.ResourceInfo
- func (p *NoopQuotaPlugin) Scrape(project core.KeystoneProject, allAZs []limes.AvailabilityZone) (result map[limesresources.ResourceName]core.ResourceData, ...)
- func (p *NoopQuotaPlugin) ScrapeRates(project core.KeystoneProject, prevSerializedState string) (result map[limesrates.RateName]*big.Int, serializedState string, err error)
- func (p *NoopQuotaPlugin) ServiceInfo(serviceType limes.ServiceType) limes.ServiceInfo
- func (p *NoopQuotaPlugin) SetQuota(project core.KeystoneProject, quotas map[limesresources.ResourceName]uint64) error
- type StaticCapacityPlugin
- func (p *StaticCapacityPlugin) CollectMetrics(ch chan<- prometheus.Metric, serializedMetrics []byte) error
- func (p *StaticCapacityPlugin) DescribeMetrics(ch chan<- *prometheus.Desc)
- func (p *StaticCapacityPlugin) Init(provider *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) error
- func (p *StaticCapacityPlugin) PluginTypeID() string
- func (p *StaticCapacityPlugin) Scrape(_ core.CapacityPluginBackchannel, allAZs []limes.AvailabilityZone) (...)
- type StaticDiscoveryPlugin
- func (p *StaticDiscoveryPlugin) Init(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) error
- func (p *StaticDiscoveryPlugin) ListDomains() ([]core.KeystoneDomain, error)
- func (p *StaticDiscoveryPlugin) ListProjects(domain core.KeystoneDomain) ([]core.KeystoneProject, error)
- func (p *StaticDiscoveryPlugin) PluginTypeID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoApprovalQuotaPlugin ¶
type AutoApprovalQuotaPlugin struct {
StaticBackendQuota uint64 `yaml:"static_backend_quota"`
}
AutoApprovalQuotaPlugin is a core.QuotaPlugin implementation for testing the auto-approval mechanism in quota scraping.
func (*AutoApprovalQuotaPlugin) CollectMetrics ¶
func (p *AutoApprovalQuotaPlugin) CollectMetrics(ch chan<- prometheus.Metric, project core.KeystoneProject, serializedMetrics []byte) error
CollectMetrics implements the core.QuotaPlugin interface.
func (*AutoApprovalQuotaPlugin) DescribeMetrics ¶
func (p *AutoApprovalQuotaPlugin) DescribeMetrics(ch chan<- *prometheus.Desc)
DescribeMetrics implements the core.QuotaPlugin interface.
func (*AutoApprovalQuotaPlugin) Init ¶
func (p *AutoApprovalQuotaPlugin) Init(provider *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) error
Init implements the core.QuotaPlugin interface.
func (*AutoApprovalQuotaPlugin) PluginTypeID ¶
func (p *AutoApprovalQuotaPlugin) PluginTypeID() string
PluginTypeID implements the core.QuotaPlugin interface.
func (*AutoApprovalQuotaPlugin) Rates ¶
func (p *AutoApprovalQuotaPlugin) Rates() []limesrates.RateInfo
Rates implements the core.QuotaPlugin interface.
func (*AutoApprovalQuotaPlugin) Resources ¶
func (p *AutoApprovalQuotaPlugin) Resources() []limesresources.ResourceInfo
Resources implements the core.QuotaPlugin interface.
func (*AutoApprovalQuotaPlugin) Scrape ¶
func (p *AutoApprovalQuotaPlugin) Scrape(project core.KeystoneProject, allAZs []limes.AvailabilityZone) (result map[limesresources.ResourceName]core.ResourceData, serializedMetrics []byte, err error)
Scrape implements the core.QuotaPlugin interface.
func (*AutoApprovalQuotaPlugin) ScrapeRates ¶
func (p *AutoApprovalQuotaPlugin) ScrapeRates(project core.KeystoneProject, prevSerializedState string) (result map[limesrates.RateName]*big.Int, serializedState string, err error)
ScrapeRates implements the core.QuotaPlugin interface.
func (*AutoApprovalQuotaPlugin) ServiceInfo ¶
func (p *AutoApprovalQuotaPlugin) ServiceInfo(serviceType limes.ServiceType) limes.ServiceInfo
ServiceInfo implements the core.QuotaPlugin interface.
func (*AutoApprovalQuotaPlugin) SetQuota ¶
func (p *AutoApprovalQuotaPlugin) SetQuota(project core.KeystoneProject, quotas map[limesresources.ResourceName]uint64) error
SetQuota implements the core.QuotaPlugin interface.
type GenericQuotaPlugin ¶
type GenericQuotaPlugin struct { StaticRateInfos []limesrates.RateInfo `yaml:"rate_infos"` StaticResourceData map[limesresources.ResourceName]*core.ResourceData `yaml:"-"` OverrideQuota map[string]map[limesresources.ResourceName]uint64 `yaml:"-"` // first key is project UUID // behavior flags that can be set by a unit test ScrapeFails bool `yaml:"-"` SetQuotaFails bool `yaml:"-"` MinQuota map[limesresources.ResourceName]uint64 `yaml:"-"` MaxQuota map[limesresources.ResourceName]uint64 `yaml:"-"` }
GenericQuotaPlugin is a core.QuotaPlugin implementation for unit tests. It mostly reports static data and offers several controls to simulate failed operations.
func (*GenericQuotaPlugin) CollectMetrics ¶
func (p *GenericQuotaPlugin) CollectMetrics(ch chan<- prometheus.Metric, project core.KeystoneProject, serializedMetrics []byte) error
CollectMetrics implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) DescribeMetrics ¶
func (p *GenericQuotaPlugin) DescribeMetrics(ch chan<- *prometheus.Desc)
DescribeMetrics implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) Init ¶
func (p *GenericQuotaPlugin) Init(provider *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) error
Init implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) PluginTypeID ¶
func (p *GenericQuotaPlugin) PluginTypeID() string
PluginTypeID implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) Rates ¶
func (p *GenericQuotaPlugin) Rates() []limesrates.RateInfo
Rates implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) Resources ¶
func (p *GenericQuotaPlugin) Resources() []limesresources.ResourceInfo
Resources implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) Scrape ¶
func (p *GenericQuotaPlugin) Scrape(project core.KeystoneProject, allAZs []limes.AvailabilityZone) (result map[limesresources.ResourceName]core.ResourceData, serializedMetrics []byte, err error)
Scrape implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) ScrapeRates ¶
func (p *GenericQuotaPlugin) ScrapeRates(project core.KeystoneProject, prevSerializedState string) (result map[limesrates.RateName]*big.Int, serializedState string, err error)
ScrapeRates implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) ServiceInfo ¶
func (p *GenericQuotaPlugin) ServiceInfo(serviceType limes.ServiceType) limes.ServiceInfo
ServiceInfo implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) SetQuota ¶
func (p *GenericQuotaPlugin) SetQuota(project core.KeystoneProject, quotas map[limesresources.ResourceName]uint64) error
SetQuota implements the core.QuotaPlugin interface.
type NoopQuotaPlugin ¶
type NoopQuotaPlugin struct {
WithEmptyResource bool `yaml:"with_empty_resource"`
}
NoopQuotaPlugin is a core.QuotaPlugin implementation for tests, with no resources or rates at all.
Alternatively, `with_empty_resource: true` can be set to report a resource with no UsageData at all (not even zero, the UsageData map just does not have any entries at all).
func (*NoopQuotaPlugin) CollectMetrics ¶
func (p *NoopQuotaPlugin) CollectMetrics(ch chan<- prometheus.Metric, project core.KeystoneProject, serializedMetrics []byte) error
CollectMetrics implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) DescribeMetrics ¶
func (p *NoopQuotaPlugin) DescribeMetrics(ch chan<- *prometheus.Desc)
DescribeMetrics implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) Init ¶
func (p *NoopQuotaPlugin) Init(provider *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) error
Init implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) PluginTypeID ¶
func (p *NoopQuotaPlugin) PluginTypeID() string
PluginTypeID implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) Rates ¶
func (p *NoopQuotaPlugin) Rates() []limesrates.RateInfo
Rates implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) Resources ¶
func (p *NoopQuotaPlugin) Resources() []limesresources.ResourceInfo
Resources implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) Scrape ¶
func (p *NoopQuotaPlugin) Scrape(project core.KeystoneProject, allAZs []limes.AvailabilityZone) (result map[limesresources.ResourceName]core.ResourceData, serializedMetrics []byte, err error)
Scrape implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) ScrapeRates ¶
func (p *NoopQuotaPlugin) ScrapeRates(project core.KeystoneProject, prevSerializedState string) (result map[limesrates.RateName]*big.Int, serializedState string, err error)
ScrapeRates implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) ServiceInfo ¶
func (p *NoopQuotaPlugin) ServiceInfo(serviceType limes.ServiceType) limes.ServiceInfo
ServiceInfo implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) SetQuota ¶
func (p *NoopQuotaPlugin) SetQuota(project core.KeystoneProject, quotas map[limesresources.ResourceName]uint64) error
SetQuota implements the core.QuotaPlugin interface.
type StaticCapacityPlugin ¶
type StaticCapacityPlugin struct { Resources []string `yaml:"resources"` // each formatted as "servicetype/resourcename" Capacity uint64 `yaml:"capacity"` WithAZCapData bool `yaml:"with_capacity_per_az"` WithSubcapacities bool `yaml:"with_subcapacities"` WithoutUsage bool `yaml:"without_usage"` }
StaticCapacityPlugin is a core.CapacityPlugin implementation for unit tests.
func (*StaticCapacityPlugin) CollectMetrics ¶
func (p *StaticCapacityPlugin) CollectMetrics(ch chan<- prometheus.Metric, serializedMetrics []byte) error
CollectMetrics implements the core.CapacityPlugin interface.
func (*StaticCapacityPlugin) DescribeMetrics ¶
func (p *StaticCapacityPlugin) DescribeMetrics(ch chan<- *prometheus.Desc)
DescribeMetrics implements the core.CapacityPlugin interface.
func (*StaticCapacityPlugin) Init ¶
func (p *StaticCapacityPlugin) Init(provider *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) error
Init implements the core.CapacityPlugin interface.
func (*StaticCapacityPlugin) PluginTypeID ¶
func (p *StaticCapacityPlugin) PluginTypeID() string
PluginTypeID implements the core.CapacityPlugin interface.
func (*StaticCapacityPlugin) Scrape ¶
func (p *StaticCapacityPlugin) Scrape(_ core.CapacityPluginBackchannel, allAZs []limes.AvailabilityZone) (result map[limes.ServiceType]map[limesresources.ResourceName]core.PerAZ[core.CapacityData], serializedMetrics []byte, err error)
Scrape implements the core.CapacityPlugin interface.
type StaticDiscoveryPlugin ¶
type StaticDiscoveryPlugin struct { Domains []core.KeystoneDomain `yaml:"domains"` Projects map[string][]core.KeystoneProject `yaml:"projects"` }
StaticDiscoveryPlugin is a core.DiscoveryPlugin implementation for unit tests. It reports a static set of domains and projects.
func (*StaticDiscoveryPlugin) Init ¶
func (p *StaticDiscoveryPlugin) Init(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) error
Init implements the core.DiscoveryPlugin interface.
func (*StaticDiscoveryPlugin) ListDomains ¶
func (p *StaticDiscoveryPlugin) ListDomains() ([]core.KeystoneDomain, error)
ListDomains implements the core.DiscoveryPlugin interface.
func (*StaticDiscoveryPlugin) ListProjects ¶
func (p *StaticDiscoveryPlugin) ListProjects(domain core.KeystoneDomain) ([]core.KeystoneProject, error)
ListProjects implements the core.DiscoveryPlugin interface.
func (*StaticDiscoveryPlugin) PluginTypeID ¶
func (p *StaticDiscoveryPlugin) PluginTypeID() string
PluginTypeID implements the core.DiscoveryPlugin interface.