Documentation
¶
Index ¶
- type GenericQuotaPlugin
- func (p *GenericQuotaPlugin) BuildServiceUsageRequest(project core.KeystoneProject, allAZs []limes.AvailabilityZone) (liquid.ServiceUsageRequest, error)
- func (p *GenericQuotaPlugin) CollectMetrics(ch chan<- prometheus.Metric, project core.KeystoneProject, ...) error
- func (p *GenericQuotaPlugin) DescribeMetrics(ch chan<- *prometheus.Desc)
- func (p *GenericQuotaPlugin) Init(ctx context.Context, provider *gophercloud.ProviderClient, ...) error
- func (p *GenericQuotaPlugin) PluginTypeID() string
- func (p *GenericQuotaPlugin) Rates() map[liquid.RateName]liquid.RateInfo
- func (p *GenericQuotaPlugin) Resources() map[liquid.ResourceName]liquid.ResourceInfo
- func (p *GenericQuotaPlugin) Scrape(ctx context.Context, project core.KeystoneProject, ...) (result map[liquid.ResourceName]core.ResourceData, serializedMetrics []byte, ...)
- func (p *GenericQuotaPlugin) ScrapeRates(ctx context.Context, project core.KeystoneProject, ...) (result map[liquid.RateName]*big.Int, serializedState string, err error)
- func (p *GenericQuotaPlugin) ServiceInfo() core.ServiceInfo
- func (p *GenericQuotaPlugin) SetQuota(ctx context.Context, project core.KeystoneProject, ...) error
- type NoopQuotaPlugin
- func (p *NoopQuotaPlugin) BuildServiceUsageRequest(project core.KeystoneProject, allAZs []limes.AvailabilityZone) (liquid.ServiceUsageRequest, error)
- func (p *NoopQuotaPlugin) CollectMetrics(ch chan<- prometheus.Metric, project core.KeystoneProject, ...) error
- func (p *NoopQuotaPlugin) DescribeMetrics(ch chan<- *prometheus.Desc)
- func (p *NoopQuotaPlugin) Init(ctx context.Context, provider *gophercloud.ProviderClient, ...) error
- func (p *NoopQuotaPlugin) PluginTypeID() string
- func (p *NoopQuotaPlugin) Rates() map[liquid.RateName]liquid.RateInfo
- func (p *NoopQuotaPlugin) Resources() map[liquid.ResourceName]liquid.ResourceInfo
- func (p *NoopQuotaPlugin) Scrape(ctx context.Context, project core.KeystoneProject, ...) (result map[liquid.ResourceName]core.ResourceData, serializedMetrics []byte, ...)
- func (p *NoopQuotaPlugin) ScrapeRates(ctx context.Context, project core.KeystoneProject, ...) (result map[liquid.RateName]*big.Int, serializedState string, err error)
- func (p *NoopQuotaPlugin) ServiceInfo() core.ServiceInfo
- func (p *NoopQuotaPlugin) SetQuota(ctx context.Context, project core.KeystoneProject, ...) error
- type StaticCapacityPlugin
- func (p *StaticCapacityPlugin) BuildServiceCapacityRequest(backchannel core.CapacityPluginBackchannel, allAZs []limes.AvailabilityZone) (liquid.ServiceCapacityRequest, error)
- func (p *StaticCapacityPlugin) CollectMetrics(ch chan<- prometheus.Metric, serializedMetrics []byte, capacitorID string) error
- func (p *StaticCapacityPlugin) DescribeMetrics(ch chan<- *prometheus.Desc)
- func (p *StaticCapacityPlugin) Init(ctx context.Context, provider *gophercloud.ProviderClient, ...) error
- func (p *StaticCapacityPlugin) PluginTypeID() string
- func (p *StaticCapacityPlugin) Scrape(ctx context.Context, _ core.CapacityPluginBackchannel, ...) (...)
- type StaticDiscoveryPlugin
- func (p *StaticDiscoveryPlugin) Init(ctx context.Context, client *gophercloud.ProviderClient, ...) error
- func (p *StaticDiscoveryPlugin) ListDomains(ctx context.Context) ([]core.KeystoneDomain, error)
- func (p *StaticDiscoveryPlugin) ListProjects(ctx context.Context, 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 GenericQuotaPlugin ¶
type GenericQuotaPlugin struct { ServiceType db.ServiceType `yaml:"-"` LiquidServiceInfo liquid.ServiceInfo `yaml:"-"` StaticRateInfos map[liquid.RateName]liquid.RateInfo `yaml:"rate_infos"` StaticResourceData map[liquid.ResourceName]*core.ResourceData `yaml:"-"` StaticResourceAttributes map[liquid.ResourceName]map[string]any `yaml:"-"` OverrideQuota map[string]map[liquid.ResourceName]liquid.ResourceQuotaRequest `yaml:"-"` // first key is project UUID // behavior flags that can be set by a unit test ReportedAZs map[liquid.AvailabilityZone]struct{} `yaml:"-"` ScrapeFails bool `yaml:"-"` SetQuotaFails bool `yaml:"-"` MinQuota map[liquid.ResourceName]uint64 `yaml:"-"` MaxQuota map[liquid.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) BuildServiceUsageRequest ¶
func (p *GenericQuotaPlugin) BuildServiceUsageRequest(project core.KeystoneProject, allAZs []limes.AvailabilityZone) (liquid.ServiceUsageRequest, error)
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(ctx context.Context, provider *gophercloud.ProviderClient, eo gophercloud.EndpointOpts, serviceType db.ServiceType) 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() map[liquid.RateName]liquid.RateInfo
Rates implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) Resources ¶
func (p *GenericQuotaPlugin) Resources() map[liquid.ResourceName]liquid.ResourceInfo
Resources implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) Scrape ¶
func (p *GenericQuotaPlugin) Scrape(ctx context.Context, project core.KeystoneProject, allAZs []limes.AvailabilityZone) (result map[liquid.ResourceName]core.ResourceData, serializedMetrics []byte, err error)
Scrape implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) ScrapeRates ¶
func (p *GenericQuotaPlugin) ScrapeRates(ctx context.Context, project core.KeystoneProject, allAZs []limes.AvailabilityZone, prevSerializedState string) (result map[liquid.RateName]*big.Int, serializedState string, err error)
ScrapeRates implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) ServiceInfo ¶
func (p *GenericQuotaPlugin) ServiceInfo() core.ServiceInfo
ServiceInfo implements the core.QuotaPlugin interface.
func (*GenericQuotaPlugin) SetQuota ¶
func (p *GenericQuotaPlugin) SetQuota(ctx context.Context, project core.KeystoneProject, quotas map[liquid.ResourceName]liquid.ResourceQuotaRequest) error
SetQuota implements the core.QuotaPlugin interface.
type NoopQuotaPlugin ¶
type NoopQuotaPlugin struct { ServiceType db.ServiceType `yaml:"-"` WithEmptyResource bool `yaml:"with_empty_resource"` WithConvertCommitments bool `yaml:"with_convert_commitments"` }
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) BuildServiceUsageRequest ¶
func (p *NoopQuotaPlugin) BuildServiceUsageRequest(project core.KeystoneProject, allAZs []limes.AvailabilityZone) (liquid.ServiceUsageRequest, error)
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(ctx context.Context, provider *gophercloud.ProviderClient, eo gophercloud.EndpointOpts, serviceType db.ServiceType) 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() map[liquid.RateName]liquid.RateInfo
Rates implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) Resources ¶
func (p *NoopQuotaPlugin) Resources() map[liquid.ResourceName]liquid.ResourceInfo
Resources implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) Scrape ¶
func (p *NoopQuotaPlugin) Scrape(ctx context.Context, project core.KeystoneProject, allAZs []limes.AvailabilityZone) (result map[liquid.ResourceName]core.ResourceData, serializedMetrics []byte, err error)
Scrape implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) ScrapeRates ¶
func (p *NoopQuotaPlugin) ScrapeRates(ctx context.Context, project core.KeystoneProject, allAZs []limes.AvailabilityZone, prevSerializedState string) (result map[liquid.RateName]*big.Int, serializedState string, err error)
ScrapeRates implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) ServiceInfo ¶
func (p *NoopQuotaPlugin) ServiceInfo() core.ServiceInfo
ServiceInfo implements the core.QuotaPlugin interface.
func (*NoopQuotaPlugin) SetQuota ¶
func (p *NoopQuotaPlugin) SetQuota(ctx context.Context, project core.KeystoneProject, quotas map[liquid.ResourceName]liquid.ResourceQuotaRequest) 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) BuildServiceCapacityRequest ¶
func (p *StaticCapacityPlugin) BuildServiceCapacityRequest(backchannel core.CapacityPluginBackchannel, allAZs []limes.AvailabilityZone) (liquid.ServiceCapacityRequest, error)
func (*StaticCapacityPlugin) CollectMetrics ¶
func (p *StaticCapacityPlugin) CollectMetrics(ch chan<- prometheus.Metric, serializedMetrics []byte, capacitorID string) 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(ctx context.Context, 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(ctx context.Context, _ core.CapacityPluginBackchannel, allAZs []limes.AvailabilityZone) (result map[db.ServiceType]map[liquid.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(ctx context.Context, client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) error
Init implements the core.DiscoveryPlugin interface.
func (*StaticDiscoveryPlugin) ListDomains ¶
func (p *StaticDiscoveryPlugin) ListDomains(ctx context.Context) ([]core.KeystoneDomain, error)
ListDomains implements the core.DiscoveryPlugin interface.
func (*StaticDiscoveryPlugin) ListProjects ¶
func (p *StaticDiscoveryPlugin) ListProjects(ctx context.Context, 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.