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
}
func NewChangeCommitmentsAPIMonitor ¶
func NewChangeCommitmentsAPIMonitor() ChangeCommitmentsAPIMonitor
func (*ChangeCommitmentsAPIMonitor) Collect ¶
func (m *ChangeCommitmentsAPIMonitor) Collect(ch chan<- prometheus.Metric)
func (*ChangeCommitmentsAPIMonitor) Describe ¶
func (m *ChangeCommitmentsAPIMonitor) Describe(ch chan<- *prometheus.Desc)
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, vmSource reservations.VMSource) *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)
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
}
func NewInfoAPIMonitor ¶
func NewInfoAPIMonitor() InfoAPIMonitor
func (*InfoAPIMonitor) Collect ¶
func (m *InfoAPIMonitor) Collect(ch chan<- prometheus.Metric)
func (*InfoAPIMonitor) Describe ¶
func (m *InfoAPIMonitor) Describe(ch chan<- *prometheus.Desc)
type QuotaAPIMonitor ¶
type QuotaAPIMonitor struct {
// contains filtered or unexported fields
}
func NewQuotaAPIMonitor ¶
func NewQuotaAPIMonitor() QuotaAPIMonitor
func (*QuotaAPIMonitor) Collect ¶
func (m *QuotaAPIMonitor) Collect(ch chan<- prometheus.Metric)
func (*QuotaAPIMonitor) Describe ¶
func (m *QuotaAPIMonitor) Describe(ch chan<- *prometheus.Desc)
type ReportCapacityAPIMonitor ¶
type ReportCapacityAPIMonitor struct {
// contains filtered or unexported fields
}
func NewReportCapacityAPIMonitor ¶
func NewReportCapacityAPIMonitor() ReportCapacityAPIMonitor
func (*ReportCapacityAPIMonitor) Collect ¶
func (m *ReportCapacityAPIMonitor) Collect(ch chan<- prometheus.Metric)
func (*ReportCapacityAPIMonitor) Describe ¶
func (m *ReportCapacityAPIMonitor) Describe(ch chan<- *prometheus.Desc)
type ReportUsageAPIMonitor ¶
type ReportUsageAPIMonitor struct {
// contains filtered or unexported fields
}
func NewReportUsageAPIMonitor ¶
func NewReportUsageAPIMonitor() ReportUsageAPIMonitor
func (*ReportUsageAPIMonitor) Collect ¶
func (m *ReportUsageAPIMonitor) Collect(ch chan<- prometheus.Metric)
func (*ReportUsageAPIMonitor) Describe ¶
func (m *ReportUsageAPIMonitor) Describe(ch chan<- *prometheus.Desc)