Documentation
¶
Index ¶
- func HasWithTimestamp(opts ...MutateOption) bool
- type CountByOrgAndStatusResult
- type DeviceApplyFunc
- type DeviceDeltaEstimates
- type DeviceListParams
- type DeviceMutation
- type DeviceRendered
- type DeviceStatusType
- type DeviceStore
- func (s *DeviceStore) ApplyLabels(ctx context.Context, orgID uuid.UUID, name string, ...) (domain.DeviceLabelApplyResult, error)
- func (s *DeviceStore) ClearDeltaPreparingIfCurrent(ctx context.Context, orgID uuid.UUID, name string, generation int64) (bool, error)
- func (s *DeviceStore) CompletionCounts(ctx context.Context, orgId uuid.UUID, owner string, templateVersion string, ...) ([]domain.DeviceCompletionCount, error)
- func (s *DeviceStore) Count(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (int64, error)
- func (s *DeviceStore) CountByLabels(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, ...) ([]map[string]any, error)
- func (s *DeviceStore) CountByOrgAndStatus(ctx context.Context, orgId *uuid.UUID, statusType DeviceStatusType, ...) ([]CountByOrgAndStatusResult, error)
- func (s *DeviceStore) Create(ctx context.Context, orgId uuid.UUID, device *domain.Device, ...) (*domain.Device, error)
- func (s *DeviceStore) Delete(ctx context.Context, orgId uuid.UUID, name string, ...) (bool, error)
- func (s *DeviceStore) Get(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, error)
- func (s *DeviceStore) GetLabelSnapshot(ctx context.Context, orgID uuid.UUID, name string) (domain.DeviceLabelSnapshot, error)
- func (s *DeviceStore) GetLabelSyncMappingIDsByKeys(ctx context.Context, orgID uuid.UUID, labelKeys []string) (map[string][]uuid.UUID, error)
- func (s *DeviceStore) GetLastSeen(ctx context.Context, orgId uuid.UUID, name string) (*time.Time, error)
- func (s *DeviceStore) GetRendered(ctx context.Context, orgId uuid.UUID, name string, ...) (*domain.Device, error)
- func (s *DeviceStore) GetRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (*domain.RepositoryList, error)
- func (s *DeviceStore) GetWithTimestamp(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, error)
- func (s *DeviceStore) Healthcheck(ctx context.Context, orgId uuid.UUID, names []string) error
- func (s *DeviceStore) InitialMigration(ctx context.Context) error
- func (s *DeviceStore) Labels(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (domain.LabelList, error)
- func (s *DeviceStore) List(ctx context.Context, orgId uuid.UUID, listParams DeviceListParams) (*domain.DeviceList, error)
- func (s *DeviceStore) ListConnectivityChanged(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, ...) (*domain.DeviceList, error)
- func (s *DeviceStore) ListDevicesByAppCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, ...) (*domain.DeviceList, error)
- func (s *DeviceStore) ListDevicesByOsCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, ...) (*domain.DeviceList, error)
- func (s *DeviceStore) ListDevicesByServiceCondition(ctx context.Context, orgId uuid.UUID, conditionType string, ...) (*domain.DeviceList, error)
- func (s *DeviceStore) ListDevicesByVolumeCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, ...) (*domain.DeviceList, error)
- func (s *DeviceStore) MarkRolloutSelection(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, limit *int) error
- func (s *DeviceStore) Mutate(ctx context.Context, orgId uuid.UUID, name string, previous *domain.Device, ...) (*domain.Device, *domain.Device, bool, error)
- func (s *DeviceStore) OverwriteRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string, repositoryNames ...string) error
- func (s *DeviceStore) ProcessAwaitingReconnectAnnotation(ctx context.Context, orgId uuid.UUID, deviceName string, ...) (bool, error)
- func (s *DeviceStore) RemoveConflictPausedAnnotation(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (int64, []string, error)
- func (s *DeviceStore) ReplaceServiceOwnedStatus(ctx context.Context, orgId uuid.UUID, device *domain.Device) (*domain.Device, *domain.Device, error)
- func (s *DeviceStore) ResumeDeltaIfCurrent(ctx context.Context, orgID uuid.UUID, name string, generation int64) (bool, error)
- func (s *DeviceStore) SetIntegrationTestCreateOrUpdateCallback(c store.IntegrationTestCallback)
- func (s *DeviceStore) SetOutOfDate(ctx context.Context, orgId uuid.UUID, owner string) error
- func (s *DeviceStore) Summary(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (*domain.DevicesSummary, error)
- func (s *DeviceStore) UnmarkRolloutSelection(ctx context.Context, orgId uuid.UUID, fleetName string) error
- func (s *DeviceStore) Update(ctx context.Context, orgId uuid.UUID, before, device *domain.Device, ...) (bool, error)
- func (s *DeviceStore) UpdateAnnotations(ctx context.Context, orgId uuid.UUID, name string, ...) error
- func (s *DeviceStore) UpdateStatus(ctx context.Context, orgId uuid.UUID, device *domain.Device, ...) (*domain.Device, *domain.Device, error)
- func (s *DeviceStore) WithTransaction(ctx context.Context, fn func(ctx context.Context) error) error
- type MutateOption
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasWithTimestamp ¶
func HasWithTimestamp(opts ...MutateOption) bool
HasWithTimestamp reports whether opts include WithTimestamp (for tests/fakes).
Types ¶
type CountByOrgAndStatusResult ¶
CountByOrgAndStatusResult holds the result of the group by query for organization and status.
type DeviceApplyFunc ¶
type DeviceApplyFunc func(m *DeviceMutation) error
DeviceApplyFunc mutates m in place on every Mutate attempt.
type DeviceDeltaEstimates ¶ added in v1.4.0
DeviceDeltaEstimates carries control-plane size estimates through a render mutation into the service-owned status store.
type DeviceListParams ¶
type DeviceListParams struct {
store.ListParams
CveID *string // Filter devices by CVE ID (join vulnerability_findings; selectors use devices.*)
}
DeviceListParams extends store.ListParams with device-specific filter options.
type DeviceMutation ¶
type DeviceMutation struct {
Device *domain.Device
Rendered *DeviceRendered
// PreserveGeneration keeps metadata.generation unchanged on PersistUpdate
// even when Spec changes (e.g. decommission historically did not bump it).
PreserveGeneration bool
}
DeviceMutation is the unit apply mutates. Handlers decide all field changes. Device is nil on the create path until apply assigns it.
func (*DeviceMutation) Clone ¶
func (m *DeviceMutation) Clone() (store.ResourceMutation[domain.Device], error)
func (*DeviceMutation) RequireExisting ¶
func (m *DeviceMutation) RequireExisting() error
RequireExisting returns ErrResourceNotFound when Device is nil (create path). Update-only callers should invoke this at the start of apply.
func (*DeviceMutation) Resource ¶
func (m *DeviceMutation) Resource() *domain.Device
func (*DeviceMutation) SetResource ¶
func (m *DeviceMutation) SetResource(device *domain.Device)
type DeviceRendered ¶
type DeviceRendered struct {
Config string
Applications string
OsImage string
// DeltaImage is the control-plane hint stored in the rendered OS spec.
DeltaImage *string
DeltaEstimates *DeviceDeltaEstimates
}
DeviceRendered holds rendered_* column values and control-plane estimates that are not represented directly on domain.Device. When set on DeviceMutation, Mutate persists them and bumps render_timestamp.
type DeviceStatusType ¶
type DeviceStatusType string
DeviceStatusType represents the type of device status to query
const ( DeviceStatusTypeSummary DeviceStatusType = "summary" DeviceStatusTypeApplication DeviceStatusType = "application" DeviceStatusTypeUpdate DeviceStatusType = "update" )
func (DeviceStatusType) String ¶
func (d DeviceStatusType) String() string
String returns the string representation of the status type
func (DeviceStatusType) Validate ¶
func (d DeviceStatusType) Validate() error
Validate ensures the status type is valid
type DeviceStore ¶
type DeviceStore struct {
// contains filtered or unexported fields
}
func NewDeviceStore ¶
func NewDeviceStore(db *gorm.DB, log logrus.FieldLogger) *DeviceStore
func (*DeviceStore) ApplyLabels ¶ added in v1.4.0
func (s *DeviceStore) ApplyLabels(ctx context.Context, orgID uuid.UUID, name string, snapshot domain.DeviceLabelSnapshot, desired map[string]domain.DesiredDeviceLabel, condition *domain.Condition) (domain.DeviceLabelApplyResult, error)
ApplyLabels atomically applies labels, their mapping owners, the managed-label annotation, and an optional reconciliation condition. Every change advances the device resource version before changing ownership rows, including owner-only transfers.
func (*DeviceStore) ClearDeltaPreparingIfCurrent ¶ added in v1.4.0
func (s *DeviceStore) ClearDeltaPreparingIfCurrent(ctx context.Context, orgID uuid.UUID, name string, generation int64) (bool, error)
ClearDeltaPreparingIfCurrent also matches an already-cleared marker, allowing a deadline retry to recover its resume event after a process failure.
func (*DeviceStore) CompletionCounts ¶
func (s *DeviceStore) CompletionCounts(ctx context.Context, orgId uuid.UUID, owner string, templateVersion string, updateTimeout *time.Duration) ([]domain.DeviceCompletionCount, error)
CompletionCounts is used for finding if a rollout batch is complete or to set the success percentage of the batch. The result is a count of devices grouped by some fields: - rendered_template_version: taken from the annotation 'device-controller/renderedTemplateVersion' - summary_status: taken from the field 'status.summary.status' - updating_reason: it is the reason field from a condition having type 'Updating' - same_rendered_version: it is the result of comparison for equality between the annotation 'device-controller/renderedVersion' and the field 'status.config.renderedVersion' - update_timed_out: it is a boolean value indicating if the update of the device has been timed out
func (*DeviceStore) Count ¶
func (s *DeviceStore) Count(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (int64, error)
func (*DeviceStore) CountByLabels ¶
func (s *DeviceStore) CountByLabels(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, groupBy []string) ([]map[string]any, error)
CountByLabels is used for rollout policy disruption budget to provide device count values grouped by the label values.
func (*DeviceStore) CountByOrgAndStatus ¶
func (s *DeviceStore) CountByOrgAndStatus(ctx context.Context, orgId *uuid.UUID, statusType DeviceStatusType, groupByFleet bool) ([]CountByOrgAndStatusResult, error)
CountByOrgAndStatus returns the count of devices grouped by org_id and status.
func (*DeviceStore) Create ¶
func (s *DeviceStore) Create(ctx context.Context, orgId uuid.UUID, device *domain.Device, rendered *DeviceRendered) (*domain.Device, error)
Create inserts a device. No events; callers fire their own callbacks. rendered is optional storage-only column data (nil on normal creates).
func (*DeviceStore) Delete ¶
func (s *DeviceStore) Delete(ctx context.Context, orgId uuid.UUID, name string, eventCallback store.EventCallback) (bool, error)
func (*DeviceStore) GetLabelSnapshot ¶ added in v1.4.0
func (s *DeviceStore) GetLabelSnapshot(ctx context.Context, orgID uuid.UUID, name string) (domain.DeviceLabelSnapshot, error)
GetLabelSnapshot reads the device and its label ownership rows from one repeatable-read snapshot.
func (*DeviceStore) GetLabelSyncMappingIDsByKeys ¶ added in v1.4.0
func (s *DeviceStore) GetLabelSyncMappingIDsByKeys(ctx context.Context, orgID uuid.UUID, labelKeys []string) (map[string][]uuid.UUID, error)
GetLabelSyncMappingIDsByKeys returns distinct current mapping IDs for exact label keys in orgID.
func (*DeviceStore) GetLastSeen ¶
func (*DeviceStore) GetRendered ¶
func (*DeviceStore) GetRepositoryRefs ¶
func (s *DeviceStore) GetRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (*domain.RepositoryList, error)
func (*DeviceStore) GetWithTimestamp ¶
func (*DeviceStore) Healthcheck ¶
func (*DeviceStore) InitialMigration ¶
func (s *DeviceStore) InitialMigration(ctx context.Context) error
func (*DeviceStore) Labels ¶
func (s *DeviceStore) Labels(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (domain.LabelList, error)
func (*DeviceStore) List ¶
func (s *DeviceStore) List(ctx context.Context, orgId uuid.UUID, listParams DeviceListParams) (*domain.DeviceList, error)
func (*DeviceStore) ListConnectivityChanged ¶
func (s *DeviceStore) ListConnectivityChanged(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, cutoffTime time.Time) (*domain.DeviceList, error)
func (*DeviceStore) ListDevicesByAppCatalogItemRef ¶
func (s *DeviceStore) ListDevicesByAppCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, listParams store.ListParams) (*domain.DeviceList, error)
func (*DeviceStore) ListDevicesByOsCatalogItemRef ¶
func (s *DeviceStore) ListDevicesByOsCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, listParams store.ListParams) (*domain.DeviceList, error)
func (*DeviceStore) ListDevicesByServiceCondition ¶
func (s *DeviceStore) ListDevicesByServiceCondition(ctx context.Context, orgId uuid.UUID, conditionType string, conditionStatus string, listParams store.ListParams) (*domain.DeviceList, error)
func (*DeviceStore) ListDevicesByVolumeCatalogItemRef ¶
func (s *DeviceStore) ListDevicesByVolumeCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, listParams store.ListParams) (*domain.DeviceList, error)
func (*DeviceStore) MarkRolloutSelection ¶
func (s *DeviceStore) MarkRolloutSelection(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, limit *int) error
MarkRolloutSelection marks all devices that can be filtered by the list params. If limit is provided then the number of marked devices will not be greater than the provided limit.
func (*DeviceStore) Mutate ¶
func (s *DeviceStore) Mutate(ctx context.Context, orgId uuid.UUID, name string, previous *domain.Device, apply DeviceApplyFunc, opts ...MutateOption) (*domain.Device, *domain.Device, bool, error)
Mutate loads the named device (or uses previous on the first attempt), runs apply, and persists via GenericStore.Mutate using Create / Update. Missing devices are created (apply must set Device); existing ones are updated. The caller is responsible for firing any event callback using the returned before/updated/created values. WithTimestamp() makes loads use a single devices⟕device_timestamps query so Status.LastSeen is set (required before UpdateServiceSideStatus).
func (*DeviceStore) OverwriteRepositoryRefs ¶
func (*DeviceStore) ProcessAwaitingReconnectAnnotation ¶
func (s *DeviceStore) ProcessAwaitingReconnectAnnotation(ctx context.Context, orgId uuid.UUID, deviceName string, deviceReportedVersion *string) (bool, error)
ProcessAwaitingReconnectAnnotation processes the AwaitingReconnect annotation for a specific device This is called from GetRenderedDevice when a device connects and has the awaiting-reconnect annotation Returns true if the device was moved to conflict paused state, false otherwise
func (*DeviceStore) RemoveConflictPausedAnnotation ¶
func (s *DeviceStore) RemoveConflictPausedAnnotation(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (int64, []string, error)
RemoveConflictPausedAnnotation removes the conflictPaused annotation from all devices matching the selector Returns the count of affected devices and their IDs
func (*DeviceStore) ReplaceServiceOwnedStatus ¶ added in v1.4.0
func (s *DeviceStore) ReplaceServiceOwnedStatus(ctx context.Context, orgId uuid.UUID, device *domain.Device) (*domain.Device, *domain.Device, error)
ReplaceServiceOwnedStatus persists the service-owned portions of a device's status while retaining the rest of the resource from the CAS-fresh row. Callers provide a device loaded by the service layer and may update service conditions (for example, delta-preparing) without changing the desired spec or agent-owned status fields.
func (*DeviceStore) ResumeDeltaIfCurrent ¶ added in v1.4.0
func (s *DeviceStore) ResumeDeltaIfCurrent(ctx context.Context, orgID uuid.UUID, name string, generation int64) (bool, error)
ResumeDeltaIfCurrent clears the device's delta-preparing state only when its desired spec generation still matches the prepare. The preparing condition is part of the predicate so a redelivered completion event cannot claim the same resource twice.
func (*DeviceStore) SetIntegrationTestCreateOrUpdateCallback ¶
func (s *DeviceStore) SetIntegrationTestCreateOrUpdateCallback(c store.IntegrationTestCallback)
func (*DeviceStore) SetOutOfDate ¶
func (*DeviceStore) Summary ¶
func (s *DeviceStore) Summary(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (*domain.DevicesSummary, error)
func (*DeviceStore) UnmarkRolloutSelection ¶
func (s *DeviceStore) UnmarkRolloutSelection(ctx context.Context, orgId uuid.UUID, fleetName string) error
UnmarkRolloutSelection unmarks all previously marked devices for rollout in a fleet
func (*DeviceStore) Update ¶
func (s *DeviceStore) Update(ctx context.Context, orgId uuid.UUID, before, device *domain.Device, rendered *DeviceRendered, preserveGeneration bool) (bool, error)
Update writes a device update. Returns retry=true on lost optimistic lock / deadlock. rendered is optional; when nil, rendered_* columns are left unchanged.
func (*DeviceStore) UpdateAnnotations ¶
func (s *DeviceStore) UpdateAnnotations(ctx context.Context, orgId uuid.UUID, name string, annotations map[string]string, deleteKeys []string) error
UpdateAnnotations merges annotations via Mutate.
func (*DeviceStore) UpdateStatus ¶
func (s *DeviceStore) UpdateStatus(ctx context.Context, orgId uuid.UUID, device *domain.Device, previous *domain.Device) (*domain.Device, *domain.Device, error)
UpdateStatus writes only status + resource_version so service_conditions (SpecValid, DependencySync, delta estimates, …) are left intact. previous is optional (first attempt).
func (*DeviceStore) WithTransaction ¶ added in v1.4.0
type MutateOption ¶
type MutateOption func(*mutateConfig)
MutateOption configures DeviceStore.Mutate.
func WithDecommissionManagedLabelCleanup ¶ added in v1.4.0
func WithDecommissionManagedLabelCleanup() MutateOption
WithDecommissionManagedLabelCleanup allows decommission to remove all labels owned by mappings. The update still has to set lifecycle to Decommissioning and clear every device label.
func WithManagedLabelMapReplacement ¶ added in v1.4.0
func WithManagedLabelMapReplacement(explicitRemovalPaths []string) MutateOption
WithManagedLabelMapReplacement preserves omitted mapping-owned labels during a whole-map device label replacement, except for explicitly removed paths.
func WithTimestamp ¶
func WithTimestamp() MutateOption
WithTimestamp loads the device via GetWithTimestamp (devices ⟕ device_timestamps) so Status.LastSeen is populated. Use when apply will call UpdateServiceSideStatus.
type Store ¶
type Store interface {
InitialMigration(ctx context.Context) error
WithTransaction(ctx context.Context, fn func(ctx context.Context) error) error
// Exposed to users
// Create inserts a device. Duplicate names return ErrDuplicateName.
// rendered is optional storage-only column data (nil on normal creates).
// No events; the caller fires its own callback.
Create(ctx context.Context, orgId uuid.UUID, device *domain.Device, rendered *DeviceRendered) (*domain.Device, error)
// Mutate loads (or uses previous once), runs apply, and persists via Create / Update.
// If the device does not exist, m.Device is nil and apply must assign it (create);
// otherwise apply mutates a clone. Returns created and the pre-mutation snapshot so
// the caller can fire its own event callback; Mutate itself never calls one.
// Create-only API callers should use Create instead. Update-only callers should call
// m.RequireExisting() in apply.
// Pass WithTimestamp() when apply will run UpdateServiceSideStatus (needs LastSeen).
Mutate(ctx context.Context, orgId uuid.UUID, name string, previous *domain.Device, apply DeviceApplyFunc, opts ...MutateOption) (updated *domain.Device, before *domain.Device, created bool, err error)
// UpdateStatus writes status + resource_version only (service_conditions unchanged).
// previous is optional (first attempt only). No events; caller uses before/updated.
UpdateStatus(ctx context.Context, orgId uuid.UUID, device *domain.Device, previous *domain.Device) (updated *domain.Device, before *domain.Device, err error)
// ReplaceServiceOwnedStatus updates service-owned status fields without
// replacing the device's desired state or agent-owned status.
ReplaceServiceOwnedStatus(ctx context.Context, orgId uuid.UUID, device *domain.Device) (updated *domain.Device, before *domain.Device, err error)
// UpdateAnnotations merges annotations (and applies deleteKeys) via Mutate.
UpdateAnnotations(ctx context.Context, orgId uuid.UUID, name string, annotations map[string]string, deleteKeys []string) error
GetLabelSnapshot(ctx context.Context, orgId uuid.UUID, name string) (domain.DeviceLabelSnapshot, error)
GetLabelSyncMappingIDsByKeys(ctx context.Context, orgId uuid.UUID, labelKeys []string) (map[string][]uuid.UUID, error)
ApplyLabels(ctx context.Context, orgId uuid.UUID, name string, snapshot domain.DeviceLabelSnapshot, desired map[string]domain.DesiredDeviceLabel, condition *domain.Condition) (domain.DeviceLabelApplyResult, error)
Get(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, error)
List(ctx context.Context, orgId uuid.UUID, listParams DeviceListParams) (*domain.DeviceList, error)
Labels(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (domain.LabelList, error)
Delete(ctx context.Context, orgId uuid.UUID, name string, eventCallback store.EventCallback) (bool, error)
GetRendered(ctx context.Context, orgId uuid.UUID, name string, knownRenderedVersion *string, consoleGrpcEndpoint string) (*domain.Device, error)
Healthcheck(ctx context.Context, orgId uuid.UUID, names []string) error
ProcessAwaitingReconnectAnnotation(ctx context.Context, orgId uuid.UUID, deviceName string, deviceReportedVersion *string) (bool, error)
GetLastSeen(ctx context.Context, orgId uuid.UUID, name string) (*time.Time, error)
// Used internally
ClearDeltaPreparingIfCurrent(ctx context.Context, orgID uuid.UUID, name string, generation int64) (bool, error)
OverwriteRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string, repositoryNames ...string) error
GetRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (*domain.RepositoryList, error)
RemoveConflictPausedAnnotation(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (int64, []string, error)
SetOutOfDate(ctx context.Context, orgId uuid.UUID, owner string) error
ListConnectivityChanged(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, cutoffTime time.Time) (*domain.DeviceList, error)
GetWithTimestamp(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, error)
// Used only by rollout
Count(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (int64, error)
UnmarkRolloutSelection(ctx context.Context, orgId uuid.UUID, fleetName string) error
MarkRolloutSelection(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, limit *int) error
CompletionCounts(ctx context.Context, orgId uuid.UUID, owner string, templateVersion string, updateTimeout *time.Duration) ([]domain.DeviceCompletionCount, error)
CountByLabels(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, groupBy []string) ([]map[string]any, error)
Summary(ctx context.Context, orgId uuid.UUID, listParams store.ListParams) (*domain.DevicesSummary, error)
// Used by fleet selector
ListDevicesByServiceCondition(ctx context.Context, orgId uuid.UUID, conditionType string, conditionStatus string, listParams store.ListParams) (*domain.DeviceList, error)
// Used by catalog
ListDevicesByOsCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, listParams store.ListParams) (*domain.DeviceList, error)
ListDevicesByAppCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, listParams store.ListParams) (*domain.DeviceList, error)
ListDevicesByVolumeCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, listParams store.ListParams) (*domain.DeviceList, error)
// Used by tests
SetIntegrationTestCreateOrUpdateCallback(store.IntegrationTestCallback)
CountByOrgAndStatus(ctx context.Context, orgId *uuid.UUID, statusType DeviceStatusType, groupByFleet bool) ([]CountByOrgAndStatusResult, error)
}