Documentation
¶
Index ¶
- type ChangeCommitmentsAPIMonitor
- type HTTPAPI
- func (api *HTTPAPI) HandleChangeCommitments(w http.ResponseWriter, r *http.Request)
- func (api *HTTPAPI) HandleInfo(w http.ResponseWriter, r *http.Request)
- func (api *HTTPAPI) HandleQuota(w http.ResponseWriter, r *http.Request)
- func (api *HTTPAPI) HandleReportCapacity(w http.ResponseWriter, r *http.Request)
- func (api *HTTPAPI) HandleReportUsage(w http.ResponseWriter, r *http.Request)
- func (api *HTTPAPI) Init(mux *http.ServeMux, registry prometheus.Registerer, log logr.Logger)
- type InfoAPIMonitor
- type QuotaAPIMonitor
- type ReportCapacityAPIMonitor
- type ReportUsageAPIMonitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeCommitmentsAPIMonitor ¶
type ChangeCommitmentsAPIMonitor struct {
// contains filtered or unexported fields
}
ChangeCommitmentsAPIMonitor provides metrics for the CR change API.
func NewChangeCommitmentsAPIMonitor ¶
func NewChangeCommitmentsAPIMonitor() ChangeCommitmentsAPIMonitor
NewChangeCommitmentsAPIMonitor creates a new monitor with Prometheus metrics. Metrics are pre-initialized with zero values for common HTTP status codes to ensure they appear in Prometheus before the first request.
func (*ChangeCommitmentsAPIMonitor) Collect ¶
func (m *ChangeCommitmentsAPIMonitor) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*ChangeCommitmentsAPIMonitor) Describe ¶
func (m *ChangeCommitmentsAPIMonitor) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
type HTTPAPI ¶
type HTTPAPI struct {
// contains filtered or unexported fields
}
HTTPAPI implements Limes LIQUID commitment validation endpoints.
func NewAPIWithConfig ¶
func NewAPIWithConfig(k8sClient client.Client, config commitments.APIConfig, usageDB commitments.UsageDBClient) *HTTPAPI
NewAPIWithConfig creates an HTTPAPI with the given config and optional usageDB client.
func (*HTTPAPI) HandleChangeCommitments ¶
func (api *HTTPAPI) HandleChangeCommitments(w http.ResponseWriter, r *http.Request)
HandleChangeCommitments implements POST /commitments/v1/change-commitments from the Limes LIQUID API. It writes CommittedResource CRDs (one per commitment) and polls their status conditions until the controller confirms or rejects each one. On any failure the whole batch is rolled back.
See: https://github.com/sapcc/go-api-declarations/blob/main/liquid/commitment.go See: https://pkg.go.dev/github.com/sapcc/go-api-declarations/liquid
func (*HTTPAPI) HandleInfo ¶
func (api *HTTPAPI) HandleInfo(w http.ResponseWriter, r *http.Request)
handles GET /commitments/v1/info requests from Limes: See: https://github.com/sapcc/go-api-declarations/blob/main/liquid/commitment.go See: https://pkg.go.dev/github.com/sapcc/go-api-declarations/liquid
func (*HTTPAPI) HandleQuota ¶
func (api *HTTPAPI) HandleQuota(w http.ResponseWriter, r *http.Request)
HandleQuota implements PUT /commitments/v1/projects/:project_id/quota from Limes LIQUID API. See: https://pkg.go.dev/github.com/sapcc/go-api-declarations/liquid
This endpoint receives quota requests from Limes and persists them as ProjectQuota CRDs. One CRD per project per availability zone, named "quota-<project-uuid>-<az>".
func (*HTTPAPI) HandleReportCapacity ¶
func (api *HTTPAPI) HandleReportCapacity(w http.ResponseWriter, r *http.Request)
handles POST /commitments/v1/report-capacity requests from Limes: See: https://github.com/sapcc/go-api-declarations/blob/main/liquid/commitment.go See: https://pkg.go.dev/github.com/sapcc/go-api-declarations/liquid Reports available capacity across all flavor group resources. Note, unit is specified in the Info API response with multiple of the smallest memory resource unit within a flavor group.
func (*HTTPAPI) HandleReportUsage ¶
func (api *HTTPAPI) HandleReportUsage(w http.ResponseWriter, r *http.Request)
HandleReportUsage implements POST /commitments/v1/projects/:project_id/report-usage from Limes LIQUID API. See: https://github.com/sapcc/go-api-declarations/blob/main/liquid/report_usage.go See: https://pkg.go.dev/github.com/sapcc/go-api-declarations/liquid
This endpoint reports usage information for a specific project's committed resources, including per-AZ usage, physical usage, and detailed VM subresources.
func (*HTTPAPI) Init ¶
func (api *HTTPAPI) Init(mux *http.ServeMux, registry prometheus.Registerer, log logr.Logger)
type InfoAPIMonitor ¶
type InfoAPIMonitor struct {
// contains filtered or unexported fields
}
InfoAPIMonitor provides metrics for the CR info API.
func NewInfoAPIMonitor ¶
func NewInfoAPIMonitor() InfoAPIMonitor
NewInfoAPIMonitor creates a new monitor with Prometheus metrics. Metrics are pre-initialized with zero values for common HTTP status codes to ensure they appear in Prometheus before the first request.
func (*InfoAPIMonitor) Collect ¶
func (m *InfoAPIMonitor) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*InfoAPIMonitor) Describe ¶
func (m *InfoAPIMonitor) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
type QuotaAPIMonitor ¶
type QuotaAPIMonitor struct {
// contains filtered or unexported fields
}
QuotaAPIMonitor provides metrics for the CR quota API.
func NewQuotaAPIMonitor ¶
func NewQuotaAPIMonitor() QuotaAPIMonitor
NewQuotaAPIMonitor creates a new monitor with Prometheus metrics. Metrics are pre-initialized with zero values for common HTTP status codes to ensure they appear in Prometheus before the first request.
func (*QuotaAPIMonitor) Collect ¶
func (m *QuotaAPIMonitor) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*QuotaAPIMonitor) Describe ¶
func (m *QuotaAPIMonitor) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
type ReportCapacityAPIMonitor ¶
type ReportCapacityAPIMonitor struct {
// contains filtered or unexported fields
}
ReportCapacityAPIMonitor provides metrics for the CR report-capacity API.
func NewReportCapacityAPIMonitor ¶
func NewReportCapacityAPIMonitor() ReportCapacityAPIMonitor
NewReportCapacityAPIMonitor creates a new monitor with Prometheus metrics. Metrics are pre-initialized with zero values for common HTTP status codes to ensure they appear in Prometheus before the first request.
func (*ReportCapacityAPIMonitor) Collect ¶
func (m *ReportCapacityAPIMonitor) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*ReportCapacityAPIMonitor) Describe ¶
func (m *ReportCapacityAPIMonitor) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
type ReportUsageAPIMonitor ¶
type ReportUsageAPIMonitor struct {
// contains filtered or unexported fields
}
ReportUsageAPIMonitor provides metrics for the CR report-usage API.
func NewReportUsageAPIMonitor ¶
func NewReportUsageAPIMonitor() ReportUsageAPIMonitor
NewReportUsageAPIMonitor creates a new monitor with Prometheus metrics. Metrics are pre-initialized with zero values for common HTTP status codes to ensure they appear in Prometheus before the first request.
func (*ReportUsageAPIMonitor) Collect ¶
func (m *ReportUsageAPIMonitor) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*ReportUsageAPIMonitor) Describe ¶
func (m *ReportUsageAPIMonitor) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.