Documentation ¶
Index ¶
- func ApplyComputedProjectQuota(serviceType limes.ServiceType, resourceName limesresources.ResourceName, ...) error
- func CanConfirmNewCommitment(req limesresources.CommitmentRequest, resourceID db.ProjectResourceID, ...) (bool, error)
- func CanMoveExistingCommitment(amount uint64, loc AZResourceLocation, ...) (bool, error)
- func ConfirmPendingCommitments(serviceType limes.ServiceType, resourceName limesresources.ResourceName, ...) error
- func NewCapacityPluginBackchannel(cluster *core.Cluster, dbi db.Interface) core.CapacityPluginBackchannel
- func ValidateProjectServices(dbi db.Interface, cluster *core.Cluster, domain db.Domain, project db.Project, ...) error
- type AZResourceLocation
- type ProjectResourceUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyComputedProjectQuota ¶
func ApplyComputedProjectQuota(serviceType limes.ServiceType, resourceName limesresources.ResourceName, dbm *gorp.DbMap, cluster *core.Cluster, now time.Time) error
ApplyComputedProjectQuota reevaluates auto-computed project quotas for the given resource, if supported by its quota distribution model.
func CanConfirmNewCommitment ¶
func CanConfirmNewCommitment(req limesresources.CommitmentRequest, resourceID db.ProjectResourceID, cluster *core.Cluster, dbi db.Interface) (bool, error)
CanConfirmNewCommitment returns whether the given commitment request can be confirmed immediately upon creation in the given project.
func CanMoveExistingCommitment ¶
func CanMoveExistingCommitment(amount uint64, loc AZResourceLocation, sourceResourceID, targetResourceID db.ProjectResourceID, cluster *core.Cluster, dbi db.Interface) (bool, error)
CanMoveExistingCommitment returns whether a commitment of the given amount at the given AZ resource location can be moved from one project to another. The projects are identified by their resource IDs.
func ConfirmPendingCommitments ¶
func ConfirmPendingCommitments(serviceType limes.ServiceType, resourceName limesresources.ResourceName, az limes.AvailabilityZone, cluster *core.Cluster, dbi db.Interface, now time.Time) error
ConfirmPendingCommitments goes through all unconfirmed commitments that could be confirmed, in chronological creation order, and confirms as many of them as possible given the currently available capacity.
func NewCapacityPluginBackchannel ¶
func NewCapacityPluginBackchannel(cluster *core.Cluster, dbi db.Interface) core.CapacityPluginBackchannel
NewCapacityPluginBackchannel builds a CapacityPluginBackchannel.
Types ¶
type AZResourceLocation ¶
type AZResourceLocation struct { ServiceType limes.ServiceType ResourceName limesresources.ResourceName AvailabilityZone limes.AvailabilityZone }
AZResourceLocation is a tuple identifying an AZ resource within a project.
type ProjectResourceUpdate ¶
type ProjectResourceUpdate struct { // A custom callback that will be called once for each resource in the given service. UpdateResource func(*db.ProjectResource) error // If nil, logg.Error is used. Unit tests should give t.Errorf here. LogError func(msg string, args ...any) }
ProjectResourceUpdate describes an operation that updates resource data within a single project service.
func (ProjectResourceUpdate) Run ¶
func (u ProjectResourceUpdate) Run(dbi db.Interface, cluster *core.Cluster, now time.Time, domain db.Domain, project db.Project, srv db.ServiceRef[db.ProjectServiceID]) ([]db.ProjectResource, error)
Run executes the given ProjectResourceUpdate operation:
- Missing ProjectResource entries are created.
- The `UpdateResource` callback is called for each resource to allow the caller to update resource data as necessary.