Documentation
¶
Overview ¶
Package device is a generated GoMock package.
Index ¶
- func CreateDeviceFromUntrusted(ctx context.Context, svc Service, orgId uuid.UUID, device domain.Device) (*domain.Device, domain.Status)
- func EmitDeviceDecommissionEvent(ctx context.Context, eventsService events.Service, _ domain.ResourceKind, ...)
- func EmitDeviceUpdatedEvent(ctx context.Context, eventsService events.Service, log logrus.FieldLogger, ...)
- func ReplaceDeviceFromUntrusted(ctx context.Context, svc Service, orgId uuid.UUID, name string, ...) (*domain.Device, domain.Status)
- func SanitizeDevice(device *domain.Device)
- type DeviceServiceHandler
- func (h *DeviceServiceHandler) CountDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (int64, domain.Status)
- func (h *DeviceServiceHandler) CountDevicesByLabels(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) ([]map[string]any, domain.Status)
- func (h *DeviceServiceHandler) CreateDevice(ctx context.Context, orgId uuid.UUID, device domain.Device) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) DecommissionDevice(ctx context.Context, orgId uuid.UUID, name string, ...) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) DeleteDevice(ctx context.Context, orgId uuid.UUID, name string) domain.Status
- func (h *DeviceServiceHandler) ForceUpdateServerSideDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) error
- func (h *DeviceServiceHandler) GetDevice(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) GetDeviceCompletionCounts(ctx context.Context, orgId uuid.UUID, owner string, templateVersion string, ...) ([]domain.DeviceCompletionCount, domain.Status)
- func (h *DeviceServiceHandler) GetDeviceLastSeen(ctx context.Context, orgId uuid.UUID, name string) (*domain.DeviceLastSeen, domain.Status)
- func (h *DeviceServiceHandler) GetDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (*domain.RepositoryList, domain.Status)
- func (h *DeviceServiceHandler) GetDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) GetDevicesSummary(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (*domain.DevicesSummary, domain.Status)
- func (h *DeviceServiceHandler) GetRenderedDevice(ctx context.Context, orgId uuid.UUID, name string, ...) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) ListConnectivityChangedDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (*domain.DeviceList, domain.Status)
- func (h *DeviceServiceHandler) ListDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (*domain.DeviceList, domain.Status)
- func (h *DeviceServiceHandler) ListDevicesByServiceCondition(ctx context.Context, orgId uuid.UUID, conditionType string, ...) (*domain.DeviceList, domain.Status)
- func (h *DeviceServiceHandler) ListLabels(ctx context.Context, orgId uuid.UUID, params domain.ListLabelsParams) (*domain.LabelList, domain.Status)
- func (h *DeviceServiceHandler) MarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) domain.Status
- func (h *DeviceServiceHandler) OverwriteDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string, repositoryNames ...string) domain.Status
- func (h *DeviceServiceHandler) PatchDevice(ctx context.Context, orgId uuid.UUID, name string, patch domain.PatchRequest, ...) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) PatchDeviceStatus(ctx context.Context, orgId uuid.UUID, name string, patch domain.PatchRequest) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) ReplaceDevice(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, ...) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) ReplaceDeviceSpec(ctx context.Context, orgId uuid.UUID, name string, expectedOwner *string, ...) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) ReplaceDeviceStatus(ctx context.Context, orgId uuid.UUID, name string, ...) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) RestartDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) ResumeDevices(ctx context.Context, orgId uuid.UUID, request domain.DeviceResumeRequest) (domain.DeviceResumeResponse, domain.Status)
- func (h *DeviceServiceHandler) SetDeviceOwner(ctx context.Context, orgId uuid.UUID, name string, expectedOwner *string, ...) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) SetDeviceServiceConditions(ctx context.Context, orgId uuid.UUID, name string, ...) domain.Status
- func (h *DeviceServiceHandler) SetOutOfDate(ctx context.Context, orgId uuid.UUID, owner string) error
- func (h *DeviceServiceHandler) StartDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) StopDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (*domain.Device, domain.Status)
- func (h *DeviceServiceHandler) UnmarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, fleetName string) domain.Status
- func (h *DeviceServiceHandler) UpdateDevice(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, ...) (*domain.Device, error)
- func (h *DeviceServiceHandler) UpdateDeviceAnnotations(ctx context.Context, orgId uuid.UUID, name string, ...) domain.Status
- func (h *DeviceServiceHandler) UpdateRenderedDevice(ctx context.Context, orgId uuid.UUID, ...) domain.Status
- func (h *DeviceServiceHandler) UpdateServerSideDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) error
- func (h *DeviceServiceHandler) UpdateServiceSideDeviceStatus(ctx context.Context, orgId uuid.UUID, device domain.Device) bool
- type MockService
- func (m *MockService) CountDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (int64, domain.Status)
- func (m *MockService) CountDevicesByLabels(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) ([]map[string]any, domain.Status)
- func (m *MockService) CreateDevice(ctx context.Context, orgId uuid.UUID, device domain.Device) (*domain.Device, domain.Status)
- func (m *MockService) DecommissionDevice(ctx context.Context, orgId uuid.UUID, name string, ...) (*domain.Device, domain.Status)
- func (m *MockService) DeleteDevice(ctx context.Context, orgId uuid.UUID, name string) domain.Status
- func (m *MockService) EXPECT() *MockServiceMockRecorder
- func (m *MockService) ForceUpdateServerSideDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) error
- func (m *MockService) GetDevice(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, domain.Status)
- func (m *MockService) GetDeviceCompletionCounts(ctx context.Context, orgId uuid.UUID, owner, templateVersion string, ...) ([]domain.DeviceCompletionCount, domain.Status)
- func (m *MockService) GetDeviceLastSeen(ctx context.Context, orgId uuid.UUID, name string) (*domain.DeviceLastSeen, domain.Status)
- func (m *MockService) GetDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (*domain.RepositoryList, domain.Status)
- func (m *MockService) GetDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, domain.Status)
- func (m *MockService) GetDevicesSummary(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (*domain.DevicesSummary, domain.Status)
- func (m *MockService) GetRenderedDevice(ctx context.Context, orgId uuid.UUID, name string, ...) (*domain.Device, domain.Status)
- func (m *MockService) ListConnectivityChangedDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (*domain.DeviceList, domain.Status)
- func (m *MockService) ListDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (*domain.DeviceList, domain.Status)
- func (m *MockService) ListDevicesByServiceCondition(ctx context.Context, orgId uuid.UUID, conditionType, conditionStatus string, ...) (*domain.DeviceList, domain.Status)
- func (m *MockService) ListLabels(ctx context.Context, orgId uuid.UUID, params domain.ListLabelsParams) (*domain.LabelList, domain.Status)
- func (m *MockService) MarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) domain.Status
- func (m *MockService) OverwriteDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string, repositoryNames ...string) domain.Status
- func (m *MockService) PatchDevice(ctx context.Context, orgId uuid.UUID, name string, patch domain.PatchRequest, ...) (*domain.Device, domain.Status)
- func (m *MockService) PatchDeviceStatus(ctx context.Context, orgId uuid.UUID, name string, patch domain.PatchRequest) (*domain.Device, domain.Status)
- func (m *MockService) ReplaceDevice(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, ...) (*domain.Device, domain.Status)
- func (m *MockService) ReplaceDeviceSpec(ctx context.Context, orgId uuid.UUID, name string, expectedOwner *string, ...) (*domain.Device, domain.Status)
- func (m *MockService) ReplaceDeviceStatus(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, ...) (*domain.Device, domain.Status)
- func (m *MockService) RestartDeviceApplication(ctx context.Context, orgId uuid.UUID, name, appName string) (*domain.Device, domain.Status)
- func (m *MockService) ResumeDevices(ctx context.Context, orgId uuid.UUID, request domain.DeviceResumeRequest) (domain.DeviceResumeResponse, domain.Status)
- func (m *MockService) SetDeviceOwner(ctx context.Context, orgId uuid.UUID, name string, ...) (*domain.Device, domain.Status)
- func (m *MockService) SetDeviceServiceConditions(ctx context.Context, orgId uuid.UUID, name string, ...) domain.Status
- func (m *MockService) SetOutOfDate(ctx context.Context, orgId uuid.UUID, owner string) error
- func (m *MockService) StartDeviceApplication(ctx context.Context, orgId uuid.UUID, name, appName string) (*domain.Device, domain.Status)
- func (m *MockService) StopDeviceApplication(ctx context.Context, orgId uuid.UUID, name, appName string) (*domain.Device, domain.Status)
- func (m *MockService) UnmarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, fleetName string) domain.Status
- func (m *MockService) UpdateDevice(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, ...) (*domain.Device, error)
- func (m *MockService) UpdateDeviceAnnotations(ctx context.Context, orgId uuid.UUID, name string, ...) domain.Status
- func (m *MockService) UpdateRenderedDevice(ctx context.Context, orgId uuid.UUID, ...) domain.Status
- func (m *MockService) UpdateServerSideDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) error
- func (m *MockService) UpdateServiceSideDeviceStatus(ctx context.Context, orgId uuid.UUID, device domain.Device) bool
- type MockServiceMockRecorder
- func (mr *MockServiceMockRecorder) CountDevices(ctx, orgId, params, annotationSelector any) *gomock.Call
- func (mr *MockServiceMockRecorder) CountDevicesByLabels(ctx, orgId, params, annotationSelector, groupBy any) *gomock.Call
- func (mr *MockServiceMockRecorder) CreateDevice(ctx, orgId, device any) *gomock.Call
- func (mr *MockServiceMockRecorder) DecommissionDevice(ctx, orgId, name, decom any) *gomock.Call
- func (mr *MockServiceMockRecorder) DeleteDevice(ctx, orgId, name any) *gomock.Call
- func (mr *MockServiceMockRecorder) ForceUpdateServerSideDeviceStatus(ctx, orgId, name any) *gomock.Call
- func (mr *MockServiceMockRecorder) GetDevice(ctx, orgId, name any) *gomock.Call
- func (mr *MockServiceMockRecorder) GetDeviceCompletionCounts(ctx, orgId, owner, templateVersion, updateTimeout any) *gomock.Call
- func (mr *MockServiceMockRecorder) GetDeviceLastSeen(ctx, orgId, name any) *gomock.Call
- func (mr *MockServiceMockRecorder) GetDeviceRepositoryRefs(ctx, orgId, name any) *gomock.Call
- func (mr *MockServiceMockRecorder) GetDeviceStatus(ctx, orgId, name any) *gomock.Call
- func (mr *MockServiceMockRecorder) GetDevicesSummary(ctx, orgId, params, annotationSelector any) *gomock.Call
- func (mr *MockServiceMockRecorder) GetRenderedDevice(ctx, orgId, name, params any) *gomock.Call
- func (mr *MockServiceMockRecorder) ListConnectivityChangedDevices(ctx, orgId, params, cutoffTime any) *gomock.Call
- func (mr *MockServiceMockRecorder) ListDevices(ctx, orgId, params, annotationSelector any) *gomock.Call
- func (mr *MockServiceMockRecorder) ListDevicesByServiceCondition(ctx, orgId, conditionType, conditionStatus, listParams any) *gomock.Call
- func (mr *MockServiceMockRecorder) ListLabels(ctx, orgId, params any) *gomock.Call
- func (mr *MockServiceMockRecorder) MarkDevicesRolloutSelection(ctx, orgId, params, annotationSelector, limit any) *gomock.Call
- func (mr *MockServiceMockRecorder) OverwriteDeviceRepositoryRefs(ctx, orgId, name any, repositoryNames ...any) *gomock.Call
- func (mr *MockServiceMockRecorder) PatchDevice(ctx, orgId, name, patch, enforceOwnership, enforceCapabilities any) *gomock.Call
- func (mr *MockServiceMockRecorder) PatchDeviceStatus(ctx, orgId, name, patch any) *gomock.Call
- func (mr *MockServiceMockRecorder) ReplaceDevice(...) *gomock.Call
- func (mr *MockServiceMockRecorder) ReplaceDeviceSpec(ctx, orgId, name, expectedOwner, spec, setAnnotations, deleteAnnotations any) *gomock.Call
- func (mr *MockServiceMockRecorder) ReplaceDeviceStatus(ctx, orgId, name, device, refreshLastSeen any) *gomock.Call
- func (mr *MockServiceMockRecorder) RestartDeviceApplication(ctx, orgId, name, appName any) *gomock.Call
- func (mr *MockServiceMockRecorder) ResumeDevices(ctx, orgId, request any) *gomock.Call
- func (mr *MockServiceMockRecorder) SetDeviceOwner(ctx, orgId, name, expectedOwner, newOwner any) *gomock.Call
- func (mr *MockServiceMockRecorder) SetDeviceServiceConditions(ctx, orgId, name, conditions any) *gomock.Call
- func (mr *MockServiceMockRecorder) SetOutOfDate(ctx, orgId, owner any) *gomock.Call
- func (mr *MockServiceMockRecorder) StartDeviceApplication(ctx, orgId, name, appName any) *gomock.Call
- func (mr *MockServiceMockRecorder) StopDeviceApplication(ctx, orgId, name, appName any) *gomock.Call
- func (mr *MockServiceMockRecorder) UnmarkDevicesRolloutSelection(ctx, orgId, fleetName any) *gomock.Call
- func (mr *MockServiceMockRecorder) UpdateDevice(ctx, orgId, name, device, fieldsToUnset any) *gomock.Call
- func (mr *MockServiceMockRecorder) UpdateDeviceAnnotations(ctx, orgId, name, annotations, deleteKeys any) *gomock.Call
- func (mr *MockServiceMockRecorder) UpdateRenderedDevice(...) *gomock.Call
- func (mr *MockServiceMockRecorder) UpdateServerSideDeviceStatus(ctx, orgId, name any) *gomock.Call
- func (mr *MockServiceMockRecorder) UpdateServiceSideDeviceStatus(ctx, orgId, device any) *gomock.Call
- type Service
- type TracedDeviceService
- func (_d *TracedDeviceService) CountDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (i1 int64, s1 domain.Status)
- func (_d *TracedDeviceService) CountDevicesByLabels(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (ma1 []map[string]any, s1 domain.Status)
- func (_d *TracedDeviceService) CreateDevice(ctx context.Context, orgId uuid.UUID, device domain.Device) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) DecommissionDevice(ctx context.Context, orgId uuid.UUID, name string, ...) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) DeleteDevice(ctx context.Context, orgId uuid.UUID, name string) (s1 domain.Status)
- func (_d *TracedDeviceService) ForceUpdateServerSideDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) (err error)
- func (_d *TracedDeviceService) GetDevice(ctx context.Context, orgId uuid.UUID, name string) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) GetDeviceCompletionCounts(ctx context.Context, orgId uuid.UUID, owner string, templateVersion string, ...) (da1 []domain.DeviceCompletionCount, s1 domain.Status)
- func (_d *TracedDeviceService) GetDeviceLastSeen(ctx context.Context, orgId uuid.UUID, name string) (dp1 *domain.DeviceLastSeen, s1 domain.Status)
- func (_d *TracedDeviceService) GetDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (rp1 *domain.RepositoryList, s1 domain.Status)
- func (_d *TracedDeviceService) GetDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) GetDevicesSummary(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (dp1 *domain.DevicesSummary, s1 domain.Status)
- func (_d *TracedDeviceService) GetRenderedDevice(ctx context.Context, orgId uuid.UUID, name string, ...) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) ListConnectivityChangedDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (dp1 *domain.DeviceList, s1 domain.Status)
- func (_d *TracedDeviceService) ListDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (dp1 *domain.DeviceList, s1 domain.Status)
- func (_d *TracedDeviceService) ListDevicesByServiceCondition(ctx context.Context, orgId uuid.UUID, conditionType string, ...) (dp1 *domain.DeviceList, s1 domain.Status)
- func (_d *TracedDeviceService) ListLabels(ctx context.Context, orgId uuid.UUID, params domain.ListLabelsParams) (lp1 *domain.LabelList, s1 domain.Status)
- func (_d *TracedDeviceService) MarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, ...) (s1 domain.Status)
- func (_d *TracedDeviceService) OverwriteDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string, repositoryNames ...string) (s1 domain.Status)
- func (_d *TracedDeviceService) PatchDevice(ctx context.Context, orgId uuid.UUID, name string, patch domain.PatchRequest, ...) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) PatchDeviceStatus(ctx context.Context, orgId uuid.UUID, name string, patch domain.PatchRequest) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) ReplaceDevice(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, ...) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) ReplaceDeviceSpec(ctx context.Context, orgId uuid.UUID, name string, expectedOwner *string, ...) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) ReplaceDeviceStatus(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, ...) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) RestartDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) ResumeDevices(ctx context.Context, orgId uuid.UUID, request domain.DeviceResumeRequest) (d1 domain.DeviceResumeResponse, s1 domain.Status)
- func (_d *TracedDeviceService) SetDeviceOwner(ctx context.Context, orgId uuid.UUID, name string, expectedOwner *string, ...) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) SetDeviceServiceConditions(ctx context.Context, orgId uuid.UUID, name string, ...) (s1 domain.Status)
- func (_d *TracedDeviceService) SetOutOfDate(ctx context.Context, orgId uuid.UUID, owner string) (err error)
- func (_d *TracedDeviceService) StartDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) StopDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (dp1 *domain.Device, s1 domain.Status)
- func (_d *TracedDeviceService) UnmarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, fleetName string) (s1 domain.Status)
- func (_d *TracedDeviceService) UpdateDevice(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, ...) (dp1 *domain.Device, err error)
- func (_d *TracedDeviceService) UpdateDeviceAnnotations(ctx context.Context, orgId uuid.UUID, name string, ...) (s1 domain.Status)
- func (_d *TracedDeviceService) UpdateRenderedDevice(ctx context.Context, orgId uuid.UUID, name string, renderedConfig string, ...) (s1 domain.Status)
- func (_d *TracedDeviceService) UpdateServerSideDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) (err error)
- func (_d *TracedDeviceService) UpdateServiceSideDeviceStatus(ctx context.Context, orgId uuid.UUID, device domain.Device) (b1 bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDeviceFromUntrusted ¶
func CreateDeviceFromUntrusted(ctx context.Context, svc Service, orgId uuid.UUID, device domain.Device) (*domain.Device, domain.Status)
CreateDeviceFromUntrusted sanitizes an untrusted device document, then creates it.
func EmitDeviceDecommissionEvent ¶
func EmitDeviceDecommissionEvent(ctx context.Context, eventsService events.Service, _ domain.ResourceKind, orgId uuid.UUID, name string, created bool, err error)
EmitDeviceDecommissionEvent handles device decommission event emission logic.
func EmitDeviceUpdatedEvent ¶
func EmitDeviceUpdatedEvent(ctx context.Context, eventsService events.Service, log logrus.FieldLogger, resourceKind domain.ResourceKind, orgId uuid.UUID, name string, oldResource, newResource interface{}, created bool, err error)
EmitDeviceUpdatedEvent handles all device-related event emission logic for a device create/update. Exported so packages that create devices as a side effect of their own operation (e.g. internal/service/enrollmentrequest, approving an enrollment request) can emit the same device-updated event a direct device update would, without depending on a generic events hub for device-specific decisions.
func ReplaceDeviceFromUntrusted ¶
func ReplaceDeviceFromUntrusted(ctx context.Context, svc Service, orgId uuid.UUID, name string, device domain.Device, fieldsToUnset []string, enforceOwnership bool, enforceCapabilities bool) (*domain.Device, domain.Status)
ReplaceDeviceFromUntrusted sanitizes an untrusted device document, then replaces it.
func SanitizeDevice ¶
SanitizeDevice clears status and managed metadata from an untrusted device document (HTTP body). Trusted callers that must preserve Owner/annotations must not use this.
Types ¶
type DeviceServiceHandler ¶
type DeviceServiceHandler struct {
// contains filtered or unexported fields
}
DeviceServiceHandler implements Service.
func (*DeviceServiceHandler) CountDevices ¶
func (h *DeviceServiceHandler) CountDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (int64, domain.Status)
func (*DeviceServiceHandler) CountDevicesByLabels ¶
func (h *DeviceServiceHandler) CountDevicesByLabels(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector, groupBy []string) ([]map[string]any, domain.Status)
func (*DeviceServiceHandler) CreateDevice ¶
func (*DeviceServiceHandler) DecommissionDevice ¶
func (*DeviceServiceHandler) DeleteDevice ¶
func (*DeviceServiceHandler) ForceUpdateServerSideDeviceStatus ¶
func (*DeviceServiceHandler) GetDeviceCompletionCounts ¶
func (*DeviceServiceHandler) GetDeviceLastSeen ¶
func (h *DeviceServiceHandler) GetDeviceLastSeen(ctx context.Context, orgId uuid.UUID, name string) (*domain.DeviceLastSeen, domain.Status)
func (*DeviceServiceHandler) GetDeviceRepositoryRefs ¶
func (h *DeviceServiceHandler) GetDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (*domain.RepositoryList, domain.Status)
func (*DeviceServiceHandler) GetDeviceStatus ¶
func (h *DeviceServiceHandler) GetDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, domain.Status)
(GET /api/v1/devices/{name}/status)
func (*DeviceServiceHandler) GetDevicesSummary ¶
func (h *DeviceServiceHandler) GetDevicesSummary(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (*domain.DevicesSummary, domain.Status)
func (*DeviceServiceHandler) GetRenderedDevice ¶
func (*DeviceServiceHandler) ListConnectivityChangedDevices ¶
func (h *DeviceServiceHandler) ListConnectivityChangedDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, cutoffTime time.Time) (*domain.DeviceList, domain.Status)
func (*DeviceServiceHandler) ListDevices ¶
func (h *DeviceServiceHandler) ListDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (*domain.DeviceList, domain.Status)
func (*DeviceServiceHandler) ListDevicesByServiceCondition ¶
func (h *DeviceServiceHandler) ListDevicesByServiceCondition(ctx context.Context, orgId uuid.UUID, conditionType string, conditionStatus string, listParams store.ListParams) (*domain.DeviceList, domain.Status)
func (*DeviceServiceHandler) ListLabels ¶
func (h *DeviceServiceHandler) ListLabels(ctx context.Context, orgId uuid.UUID, params domain.ListLabelsParams) (*domain.LabelList, domain.Status)
ListLabels only ever supports domain.DeviceKind (its monolith implementation never handled any other kind), so it moves here verbatim rather than to a new cross-resource home.
func (*DeviceServiceHandler) MarkDevicesRolloutSelection ¶
func (h *DeviceServiceHandler) MarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector, limit *int) domain.Status
func (*DeviceServiceHandler) OverwriteDeviceRepositoryRefs ¶
func (*DeviceServiceHandler) PatchDevice ¶
func (h *DeviceServiceHandler) PatchDevice(ctx context.Context, orgId uuid.UUID, name string, patch domain.PatchRequest, enforceOwnership bool, enforceCapabilities bool) (*domain.Device, domain.Status)
Only metadata.labels and spec can be patched. If we try to patch other fields, HTTP 400 Bad Request is returned.
func (*DeviceServiceHandler) PatchDeviceStatus ¶
func (*DeviceServiceHandler) ReplaceDevice ¶
func (*DeviceServiceHandler) ReplaceDeviceSpec ¶
func (h *DeviceServiceHandler) ReplaceDeviceSpec(ctx context.Context, orgId uuid.UUID, name string, expectedOwner *string, spec domain.DeviceSpec, setAnnotations map[string]string, deleteAnnotations []string) (*domain.Device, domain.Status)
ReplaceDeviceSpec is the internal-reconciler counterpart to ReplaceDevice: it overwrites Spec and merges setAnnotations/deleteAnnotations into the existing annotation map, without requiring the caller's resourceVersion to match. Ownership is re-verified against the freshly-loaded device on every retry attempt (not a stale caller-held snapshot), so a concurrent owner change is still caught. Labels are never touched.
func (*DeviceServiceHandler) ReplaceDeviceStatus ¶
func (*DeviceServiceHandler) RestartDeviceApplication ¶
func (h *DeviceServiceHandler) RestartDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (*domain.Device, domain.Status)
RestartDeviceApplication increments the device-level restartGeneration override for the named application, atomically against concurrent restarts. restartGeneration is device-only and left untouched by stop/start, so it's safe to simply increment whatever is currently stored.
func (*DeviceServiceHandler) ResumeDevices ¶
func (h *DeviceServiceHandler) ResumeDevices(ctx context.Context, orgId uuid.UUID, request domain.DeviceResumeRequest) (domain.DeviceResumeResponse, domain.Status)
func (*DeviceServiceHandler) SetDeviceOwner ¶
func (h *DeviceServiceHandler) SetDeviceOwner(ctx context.Context, orgId uuid.UUID, name string, expectedOwner *string, newOwner *string) (*domain.Device, domain.Status)
SetDeviceOwner sets (newOwner non-nil) or clears (newOwner nil) only Owner, re-verified against the freshly-loaded device's owner on every retry attempt. Spec/Labels/Annotations are never part of the write payload, so this cannot race with heartbeats or clobber a concurrently-rendered spec the way a full ReplaceDevice call would.
func (*DeviceServiceHandler) SetDeviceServiceConditions ¶
func (*DeviceServiceHandler) SetOutOfDate ¶
func (*DeviceServiceHandler) StartDeviceApplication ¶
func (h *DeviceServiceHandler) StartDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (*domain.Device, domain.Status)
StartDeviceApplication sets a device-level override so that the named application's desiredState is "running", independent of the application's declarative spec. Same recency-based arbitration against the fleet-level default as StopDeviceApplication.
func (*DeviceServiceHandler) StopDeviceApplication ¶
func (h *DeviceServiceHandler) StopDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (*domain.Device, domain.Status)
StopDeviceApplication sets a device-level override so that the named application's desiredState is "stopped", independent of the application's declarative spec. The override is stamped with a fresh version so it wins over an earlier fleet-level default for the same application, as long as no more recent fleet-level action has been taken since.
func (*DeviceServiceHandler) UnmarkDevicesRolloutSelection ¶
func (*DeviceServiceHandler) UpdateDevice ¶
func (*DeviceServiceHandler) UpdateDeviceAnnotations ¶
func (*DeviceServiceHandler) UpdateRenderedDevice ¶
func (*DeviceServiceHandler) UpdateServerSideDeviceStatus ¶
func (*DeviceServiceHandler) UpdateServiceSideDeviceStatus ¶
type MockService ¶
type MockService struct {
// contains filtered or unexported fields
}
MockService is a mock of Service interface.
func NewMockService ¶
func NewMockService(ctrl *gomock.Controller) *MockService
NewMockService creates a new mock instance.
func (*MockService) CountDevices ¶
func (m *MockService) CountDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (int64, domain.Status)
CountDevices mocks base method.
func (*MockService) CountDevicesByLabels ¶
func (m *MockService) CountDevicesByLabels(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector, groupBy []string) ([]map[string]any, domain.Status)
CountDevicesByLabels mocks base method.
func (*MockService) CreateDevice ¶
func (m *MockService) CreateDevice(ctx context.Context, orgId uuid.UUID, device domain.Device) (*domain.Device, domain.Status)
CreateDevice mocks base method.
func (*MockService) DecommissionDevice ¶
func (m *MockService) DecommissionDevice(ctx context.Context, orgId uuid.UUID, name string, decom domain.DeviceDecommission) (*domain.Device, domain.Status)
DecommissionDevice mocks base method.
func (*MockService) DeleteDevice ¶
DeleteDevice mocks base method.
func (*MockService) EXPECT ¶
func (m *MockService) EXPECT() *MockServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockService) ForceUpdateServerSideDeviceStatus ¶
func (m *MockService) ForceUpdateServerSideDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) error
ForceUpdateServerSideDeviceStatus mocks base method.
func (*MockService) GetDevice ¶
func (m *MockService) GetDevice(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, domain.Status)
GetDevice mocks base method.
func (*MockService) GetDeviceCompletionCounts ¶
func (m *MockService) GetDeviceCompletionCounts(ctx context.Context, orgId uuid.UUID, owner, templateVersion string, updateTimeout *time.Duration) ([]domain.DeviceCompletionCount, domain.Status)
GetDeviceCompletionCounts mocks base method.
func (*MockService) GetDeviceLastSeen ¶
func (m *MockService) GetDeviceLastSeen(ctx context.Context, orgId uuid.UUID, name string) (*domain.DeviceLastSeen, domain.Status)
GetDeviceLastSeen mocks base method.
func (*MockService) GetDeviceRepositoryRefs ¶
func (m *MockService) GetDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (*domain.RepositoryList, domain.Status)
GetDeviceRepositoryRefs mocks base method.
func (*MockService) GetDeviceStatus ¶
func (m *MockService) GetDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, domain.Status)
GetDeviceStatus mocks base method.
func (*MockService) GetDevicesSummary ¶
func (m *MockService) GetDevicesSummary(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (*domain.DevicesSummary, domain.Status)
GetDevicesSummary mocks base method.
func (*MockService) GetRenderedDevice ¶
func (m *MockService) GetRenderedDevice(ctx context.Context, orgId uuid.UUID, name string, params domain.GetRenderedDeviceParams) (*domain.Device, domain.Status)
GetRenderedDevice mocks base method.
func (*MockService) ListConnectivityChangedDevices ¶
func (m *MockService) ListConnectivityChangedDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, cutoffTime time.Time) (*domain.DeviceList, domain.Status)
ListConnectivityChangedDevices mocks base method.
func (*MockService) ListDevices ¶
func (m *MockService) ListDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (*domain.DeviceList, domain.Status)
ListDevices mocks base method.
func (*MockService) ListDevicesByServiceCondition ¶
func (m *MockService) ListDevicesByServiceCondition(ctx context.Context, orgId uuid.UUID, conditionType, conditionStatus string, listParams store.ListParams) (*domain.DeviceList, domain.Status)
ListDevicesByServiceCondition mocks base method.
func (*MockService) ListLabels ¶
func (m *MockService) ListLabels(ctx context.Context, orgId uuid.UUID, params domain.ListLabelsParams) (*domain.LabelList, domain.Status)
ListLabels mocks base method.
func (*MockService) MarkDevicesRolloutSelection ¶
func (m *MockService) MarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector, limit *int) domain.Status
MarkDevicesRolloutSelection mocks base method.
func (*MockService) OverwriteDeviceRepositoryRefs ¶
func (m *MockService) OverwriteDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string, repositoryNames ...string) domain.Status
OverwriteDeviceRepositoryRefs mocks base method.
func (*MockService) PatchDevice ¶
func (m *MockService) PatchDevice(ctx context.Context, orgId uuid.UUID, name string, patch domain.PatchRequest, enforceOwnership, enforceCapabilities bool) (*domain.Device, domain.Status)
PatchDevice mocks base method.
func (*MockService) PatchDeviceStatus ¶
func (m *MockService) PatchDeviceStatus(ctx context.Context, orgId uuid.UUID, name string, patch domain.PatchRequest) (*domain.Device, domain.Status)
PatchDeviceStatus mocks base method.
func (*MockService) ReplaceDevice ¶
func (m *MockService) ReplaceDevice(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, fieldsToUnset []string, enforceOwnership, enforceCapabilities bool) (*domain.Device, domain.Status)
ReplaceDevice mocks base method.
func (*MockService) ReplaceDeviceSpec ¶
func (m *MockService) ReplaceDeviceSpec(ctx context.Context, orgId uuid.UUID, name string, expectedOwner *string, spec domain.DeviceSpec, setAnnotations map[string]string, deleteAnnotations []string) (*domain.Device, domain.Status)
ReplaceDeviceSpec mocks base method.
func (*MockService) ReplaceDeviceStatus ¶
func (m *MockService) ReplaceDeviceStatus(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, refreshLastSeen bool) (*domain.Device, domain.Status)
ReplaceDeviceStatus mocks base method.
func (*MockService) RestartDeviceApplication ¶
func (m *MockService) RestartDeviceApplication(ctx context.Context, orgId uuid.UUID, name, appName string) (*domain.Device, domain.Status)
RestartDeviceApplication mocks base method.
func (*MockService) ResumeDevices ¶
func (m *MockService) ResumeDevices(ctx context.Context, orgId uuid.UUID, request domain.DeviceResumeRequest) (domain.DeviceResumeResponse, domain.Status)
ResumeDevices mocks base method.
func (*MockService) SetDeviceOwner ¶
func (m *MockService) SetDeviceOwner(ctx context.Context, orgId uuid.UUID, name string, expectedOwner, newOwner *string) (*domain.Device, domain.Status)
SetDeviceOwner mocks base method.
func (*MockService) SetDeviceServiceConditions ¶
func (m *MockService) SetDeviceServiceConditions(ctx context.Context, orgId uuid.UUID, name string, conditions []domain.Condition) domain.Status
SetDeviceServiceConditions mocks base method.
func (*MockService) SetOutOfDate ¶
SetOutOfDate mocks base method.
func (*MockService) StartDeviceApplication ¶
func (m *MockService) StartDeviceApplication(ctx context.Context, orgId uuid.UUID, name, appName string) (*domain.Device, domain.Status)
StartDeviceApplication mocks base method.
func (*MockService) StopDeviceApplication ¶
func (m *MockService) StopDeviceApplication(ctx context.Context, orgId uuid.UUID, name, appName string) (*domain.Device, domain.Status)
StopDeviceApplication mocks base method.
func (*MockService) UnmarkDevicesRolloutSelection ¶
func (m *MockService) UnmarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, fleetName string) domain.Status
UnmarkDevicesRolloutSelection mocks base method.
func (*MockService) UpdateDevice ¶
func (m *MockService) UpdateDevice(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, fieldsToUnset []string) (*domain.Device, error)
UpdateDevice mocks base method.
func (*MockService) UpdateDeviceAnnotations ¶
func (m *MockService) UpdateDeviceAnnotations(ctx context.Context, orgId uuid.UUID, name string, annotations map[string]string, deleteKeys []string) domain.Status
UpdateDeviceAnnotations mocks base method.
func (*MockService) UpdateRenderedDevice ¶
func (m *MockService) UpdateRenderedDevice(ctx context.Context, orgId uuid.UUID, name, renderedConfig, renderedApplications, specHash, osImage string, configFingerprints []domain.DependencySyncConfigRefStatus, forceUpdate bool) domain.Status
UpdateRenderedDevice mocks base method.
func (*MockService) UpdateServerSideDeviceStatus ¶
func (m *MockService) UpdateServerSideDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) error
UpdateServerSideDeviceStatus mocks base method.
func (*MockService) UpdateServiceSideDeviceStatus ¶
func (m *MockService) UpdateServiceSideDeviceStatus(ctx context.Context, orgId uuid.UUID, device domain.Device) bool
UpdateServiceSideDeviceStatus mocks base method.
type MockServiceMockRecorder ¶
type MockServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceMockRecorder is the mock recorder for MockService.
func (*MockServiceMockRecorder) CountDevices ¶
func (mr *MockServiceMockRecorder) CountDevices(ctx, orgId, params, annotationSelector any) *gomock.Call
CountDevices indicates an expected call of CountDevices.
func (*MockServiceMockRecorder) CountDevicesByLabels ¶
func (mr *MockServiceMockRecorder) CountDevicesByLabels(ctx, orgId, params, annotationSelector, groupBy any) *gomock.Call
CountDevicesByLabels indicates an expected call of CountDevicesByLabels.
func (*MockServiceMockRecorder) CreateDevice ¶
func (mr *MockServiceMockRecorder) CreateDevice(ctx, orgId, device any) *gomock.Call
CreateDevice indicates an expected call of CreateDevice.
func (*MockServiceMockRecorder) DecommissionDevice ¶
func (mr *MockServiceMockRecorder) DecommissionDevice(ctx, orgId, name, decom any) *gomock.Call
DecommissionDevice indicates an expected call of DecommissionDevice.
func (*MockServiceMockRecorder) DeleteDevice ¶
func (mr *MockServiceMockRecorder) DeleteDevice(ctx, orgId, name any) *gomock.Call
DeleteDevice indicates an expected call of DeleteDevice.
func (*MockServiceMockRecorder) ForceUpdateServerSideDeviceStatus ¶
func (mr *MockServiceMockRecorder) ForceUpdateServerSideDeviceStatus(ctx, orgId, name any) *gomock.Call
ForceUpdateServerSideDeviceStatus indicates an expected call of ForceUpdateServerSideDeviceStatus.
func (*MockServiceMockRecorder) GetDevice ¶
func (mr *MockServiceMockRecorder) GetDevice(ctx, orgId, name any) *gomock.Call
GetDevice indicates an expected call of GetDevice.
func (*MockServiceMockRecorder) GetDeviceCompletionCounts ¶
func (mr *MockServiceMockRecorder) GetDeviceCompletionCounts(ctx, orgId, owner, templateVersion, updateTimeout any) *gomock.Call
GetDeviceCompletionCounts indicates an expected call of GetDeviceCompletionCounts.
func (*MockServiceMockRecorder) GetDeviceLastSeen ¶
func (mr *MockServiceMockRecorder) GetDeviceLastSeen(ctx, orgId, name any) *gomock.Call
GetDeviceLastSeen indicates an expected call of GetDeviceLastSeen.
func (*MockServiceMockRecorder) GetDeviceRepositoryRefs ¶
func (mr *MockServiceMockRecorder) GetDeviceRepositoryRefs(ctx, orgId, name any) *gomock.Call
GetDeviceRepositoryRefs indicates an expected call of GetDeviceRepositoryRefs.
func (*MockServiceMockRecorder) GetDeviceStatus ¶
func (mr *MockServiceMockRecorder) GetDeviceStatus(ctx, orgId, name any) *gomock.Call
GetDeviceStatus indicates an expected call of GetDeviceStatus.
func (*MockServiceMockRecorder) GetDevicesSummary ¶
func (mr *MockServiceMockRecorder) GetDevicesSummary(ctx, orgId, params, annotationSelector any) *gomock.Call
GetDevicesSummary indicates an expected call of GetDevicesSummary.
func (*MockServiceMockRecorder) GetRenderedDevice ¶
func (mr *MockServiceMockRecorder) GetRenderedDevice(ctx, orgId, name, params any) *gomock.Call
GetRenderedDevice indicates an expected call of GetRenderedDevice.
func (*MockServiceMockRecorder) ListConnectivityChangedDevices ¶
func (mr *MockServiceMockRecorder) ListConnectivityChangedDevices(ctx, orgId, params, cutoffTime any) *gomock.Call
ListConnectivityChangedDevices indicates an expected call of ListConnectivityChangedDevices.
func (*MockServiceMockRecorder) ListDevices ¶
func (mr *MockServiceMockRecorder) ListDevices(ctx, orgId, params, annotationSelector any) *gomock.Call
ListDevices indicates an expected call of ListDevices.
func (*MockServiceMockRecorder) ListDevicesByServiceCondition ¶
func (mr *MockServiceMockRecorder) ListDevicesByServiceCondition(ctx, orgId, conditionType, conditionStatus, listParams any) *gomock.Call
ListDevicesByServiceCondition indicates an expected call of ListDevicesByServiceCondition.
func (*MockServiceMockRecorder) ListLabels ¶
func (mr *MockServiceMockRecorder) ListLabels(ctx, orgId, params any) *gomock.Call
ListLabels indicates an expected call of ListLabels.
func (*MockServiceMockRecorder) MarkDevicesRolloutSelection ¶
func (mr *MockServiceMockRecorder) MarkDevicesRolloutSelection(ctx, orgId, params, annotationSelector, limit any) *gomock.Call
MarkDevicesRolloutSelection indicates an expected call of MarkDevicesRolloutSelection.
func (*MockServiceMockRecorder) OverwriteDeviceRepositoryRefs ¶
func (mr *MockServiceMockRecorder) OverwriteDeviceRepositoryRefs(ctx, orgId, name any, repositoryNames ...any) *gomock.Call
OverwriteDeviceRepositoryRefs indicates an expected call of OverwriteDeviceRepositoryRefs.
func (*MockServiceMockRecorder) PatchDevice ¶
func (mr *MockServiceMockRecorder) PatchDevice(ctx, orgId, name, patch, enforceOwnership, enforceCapabilities any) *gomock.Call
PatchDevice indicates an expected call of PatchDevice.
func (*MockServiceMockRecorder) PatchDeviceStatus ¶
func (mr *MockServiceMockRecorder) PatchDeviceStatus(ctx, orgId, name, patch any) *gomock.Call
PatchDeviceStatus indicates an expected call of PatchDeviceStatus.
func (*MockServiceMockRecorder) ReplaceDevice ¶
func (mr *MockServiceMockRecorder) ReplaceDevice(ctx, orgId, name, device, fieldsToUnset, enforceOwnership, enforceCapabilities any) *gomock.Call
ReplaceDevice indicates an expected call of ReplaceDevice.
func (*MockServiceMockRecorder) ReplaceDeviceSpec ¶
func (mr *MockServiceMockRecorder) ReplaceDeviceSpec(ctx, orgId, name, expectedOwner, spec, setAnnotations, deleteAnnotations any) *gomock.Call
ReplaceDeviceSpec indicates an expected call of ReplaceDeviceSpec.
func (*MockServiceMockRecorder) ReplaceDeviceStatus ¶
func (mr *MockServiceMockRecorder) ReplaceDeviceStatus(ctx, orgId, name, device, refreshLastSeen any) *gomock.Call
ReplaceDeviceStatus indicates an expected call of ReplaceDeviceStatus.
func (*MockServiceMockRecorder) RestartDeviceApplication ¶
func (mr *MockServiceMockRecorder) RestartDeviceApplication(ctx, orgId, name, appName any) *gomock.Call
RestartDeviceApplication indicates an expected call of RestartDeviceApplication.
func (*MockServiceMockRecorder) ResumeDevices ¶
func (mr *MockServiceMockRecorder) ResumeDevices(ctx, orgId, request any) *gomock.Call
ResumeDevices indicates an expected call of ResumeDevices.
func (*MockServiceMockRecorder) SetDeviceOwner ¶
func (mr *MockServiceMockRecorder) SetDeviceOwner(ctx, orgId, name, expectedOwner, newOwner any) *gomock.Call
SetDeviceOwner indicates an expected call of SetDeviceOwner.
func (*MockServiceMockRecorder) SetDeviceServiceConditions ¶
func (mr *MockServiceMockRecorder) SetDeviceServiceConditions(ctx, orgId, name, conditions any) *gomock.Call
SetDeviceServiceConditions indicates an expected call of SetDeviceServiceConditions.
func (*MockServiceMockRecorder) SetOutOfDate ¶
func (mr *MockServiceMockRecorder) SetOutOfDate(ctx, orgId, owner any) *gomock.Call
SetOutOfDate indicates an expected call of SetOutOfDate.
func (*MockServiceMockRecorder) StartDeviceApplication ¶
func (mr *MockServiceMockRecorder) StartDeviceApplication(ctx, orgId, name, appName any) *gomock.Call
StartDeviceApplication indicates an expected call of StartDeviceApplication.
func (*MockServiceMockRecorder) StopDeviceApplication ¶
func (mr *MockServiceMockRecorder) StopDeviceApplication(ctx, orgId, name, appName any) *gomock.Call
StopDeviceApplication indicates an expected call of StopDeviceApplication.
func (*MockServiceMockRecorder) UnmarkDevicesRolloutSelection ¶
func (mr *MockServiceMockRecorder) UnmarkDevicesRolloutSelection(ctx, orgId, fleetName any) *gomock.Call
UnmarkDevicesRolloutSelection indicates an expected call of UnmarkDevicesRolloutSelection.
func (*MockServiceMockRecorder) UpdateDevice ¶
func (mr *MockServiceMockRecorder) UpdateDevice(ctx, orgId, name, device, fieldsToUnset any) *gomock.Call
UpdateDevice indicates an expected call of UpdateDevice.
func (*MockServiceMockRecorder) UpdateDeviceAnnotations ¶
func (mr *MockServiceMockRecorder) UpdateDeviceAnnotations(ctx, orgId, name, annotations, deleteKeys any) *gomock.Call
UpdateDeviceAnnotations indicates an expected call of UpdateDeviceAnnotations.
func (*MockServiceMockRecorder) UpdateRenderedDevice ¶
func (mr *MockServiceMockRecorder) UpdateRenderedDevice(ctx, orgId, name, renderedConfig, renderedApplications, specHash, osImage, configFingerprints, forceUpdate any) *gomock.Call
UpdateRenderedDevice indicates an expected call of UpdateRenderedDevice.
func (*MockServiceMockRecorder) UpdateServerSideDeviceStatus ¶
func (mr *MockServiceMockRecorder) UpdateServerSideDeviceStatus(ctx, orgId, name any) *gomock.Call
UpdateServerSideDeviceStatus indicates an expected call of UpdateServerSideDeviceStatus.
func (*MockServiceMockRecorder) UpdateServiceSideDeviceStatus ¶
func (mr *MockServiceMockRecorder) UpdateServiceSideDeviceStatus(ctx, orgId, device any) *gomock.Call
UpdateServiceSideDeviceStatus indicates an expected call of UpdateServiceSideDeviceStatus.
type Service ¶
type Service interface {
CreateDevice(ctx context.Context, orgId uuid.UUID, device domain.Device) (*domain.Device, domain.Status)
ListDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (*domain.DeviceList, domain.Status)
ListDevicesByServiceCondition(ctx context.Context, orgId uuid.UUID, conditionType string, conditionStatus string, listParams store.ListParams) (*domain.DeviceList, domain.Status)
UpdateDevice(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, fieldsToUnset []string) (*domain.Device, error)
GetDevice(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, domain.Status)
ReplaceDevice(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, fieldsToUnset []string, enforceOwnership bool, enforceCapabilities bool) (*domain.Device, domain.Status)
// ReplaceDeviceSpec overwrites Spec and merges the given annotation changes for an
// internal reconciler that already owns this device (fleet rollout). It does not
// require the caller's resourceVersion to match, and never touches Labels or Owner,
// so it cannot race with agent status heartbeats or clobber concurrent label/owner
// writes. expectedOwner is checked against the freshly loaded owner on every retry
// attempt; a mismatch returns a conflict so callers can detect it exactly as they
// would a resourceVersion conflict today.
ReplaceDeviceSpec(ctx context.Context, orgId uuid.UUID, name string, expectedOwner *string, spec domain.DeviceSpec, setAnnotations map[string]string, deleteAnnotations []string) (*domain.Device, domain.Status)
// SetDeviceOwner sets (or clears, when newOwner is nil) only the Owner field.
// Like ReplaceDeviceSpec, it skips resourceVersion matching and never touches
// Spec/Labels/Annotations, so fleet-selector reassignment can't race with heartbeats
// or silently overwrite a concurrently-rendered spec.
SetDeviceOwner(ctx context.Context, orgId uuid.UUID, name string, expectedOwner *string, newOwner *string) (*domain.Device, domain.Status)
DeleteDevice(ctx context.Context, orgId uuid.UUID, name string) domain.Status
GetDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) (*domain.Device, domain.Status)
GetDeviceLastSeen(ctx context.Context, orgId uuid.UUID, name string) (*domain.DeviceLastSeen, domain.Status)
ReplaceDeviceStatus(ctx context.Context, orgId uuid.UUID, name string, device domain.Device, refreshLastSeen bool) (*domain.Device, domain.Status)
PatchDeviceStatus(ctx context.Context, orgId uuid.UUID, name string, patch domain.PatchRequest) (*domain.Device, domain.Status)
GetRenderedDevice(ctx context.Context, orgId uuid.UUID, name string, params domain.GetRenderedDeviceParams) (*domain.Device, domain.Status)
PatchDevice(ctx context.Context, orgId uuid.UUID, name string, patch domain.PatchRequest, enforceOwnership bool, enforceCapabilities bool) (*domain.Device, domain.Status)
DecommissionDevice(ctx context.Context, orgId uuid.UUID, name string, decom domain.DeviceDecommission) (*domain.Device, domain.Status)
ResumeDevices(ctx context.Context, orgId uuid.UUID, request domain.DeviceResumeRequest) (domain.DeviceResumeResponse, domain.Status)
UpdateDeviceAnnotations(ctx context.Context, orgId uuid.UUID, name string, annotations map[string]string, deleteKeys []string) domain.Status
StopDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (*domain.Device, domain.Status)
StartDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (*domain.Device, domain.Status)
RestartDeviceApplication(ctx context.Context, orgId uuid.UUID, name string, appName string) (*domain.Device, domain.Status)
UpdateRenderedDevice(ctx context.Context, orgId uuid.UUID, name, renderedConfig, renderedApplications, specHash, osImage string, configFingerprints []domain.DependencySyncConfigRefStatus, forceUpdate bool) domain.Status
SetDeviceServiceConditions(ctx context.Context, orgId uuid.UUID, name string, conditions []domain.Condition) domain.Status
OverwriteDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string, repositoryNames ...string) domain.Status
GetDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (*domain.RepositoryList, domain.Status)
CountDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (int64, domain.Status)
UnmarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, fleetName string) domain.Status
MarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector, limit *int) domain.Status
GetDeviceCompletionCounts(ctx context.Context, orgId uuid.UUID, owner string, templateVersion string, updateTimeout *time.Duration) ([]domain.DeviceCompletionCount, domain.Status)
CountDevicesByLabels(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector, groupBy []string) ([]map[string]any, domain.Status)
GetDevicesSummary(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (*domain.DevicesSummary, domain.Status)
UpdateServiceSideDeviceStatus(ctx context.Context, orgId uuid.UUID, device domain.Device) bool
SetOutOfDate(ctx context.Context, orgId uuid.UUID, owner string) error
UpdateServerSideDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) error
ForceUpdateServerSideDeviceStatus(ctx context.Context, orgId uuid.UUID, name string) error
ListConnectivityChangedDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, cutoffTime time.Time) (*domain.DeviceList, domain.Status)
ListLabels(ctx context.Context, orgId uuid.UUID, params domain.ListLabelsParams) (*domain.LabelList, domain.Status)
}
func NewDeviceServiceHandler ¶
func NewDeviceServiceHandler( deviceStore devicestore.Store, catalogStore catalogstore.Store, fleetStore fleetstore.Store, events events.Service, kvStore kvstore.KVStore, agentEndpoint string, log logrus.FieldLogger, ) Service
NewDeviceServiceHandler creates a new DeviceServiceHandler instance. catalogStore is optional — when nil, catalog item ref validation is skipped.
func WrapWithTracing ¶
WrapWithTracing returns a Service that wraps inner with tracing spans, or nil if inner is nil.
type TracedDeviceService ¶
type TracedDeviceService struct {
// contains filtered or unexported fields
}
TracedDeviceService wraps a Service implementation with OpenTelemetry tracing.
func (*TracedDeviceService) CountDevices ¶
func (_d *TracedDeviceService) CountDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (i1 int64, s1 domain.Status)
func (*TracedDeviceService) CountDevicesByLabels ¶
func (_d *TracedDeviceService) CountDevicesByLabels(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector, groupBy []string) (ma1 []map[string]any, s1 domain.Status)
func (*TracedDeviceService) CreateDevice ¶
func (*TracedDeviceService) DecommissionDevice ¶
func (*TracedDeviceService) DeleteDevice ¶
func (*TracedDeviceService) ForceUpdateServerSideDeviceStatus ¶
func (*TracedDeviceService) GetDeviceCompletionCounts ¶
func (*TracedDeviceService) GetDeviceLastSeen ¶
func (_d *TracedDeviceService) GetDeviceLastSeen(ctx context.Context, orgId uuid.UUID, name string) (dp1 *domain.DeviceLastSeen, s1 domain.Status)
func (*TracedDeviceService) GetDeviceRepositoryRefs ¶
func (_d *TracedDeviceService) GetDeviceRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (rp1 *domain.RepositoryList, s1 domain.Status)
func (*TracedDeviceService) GetDeviceStatus ¶
func (*TracedDeviceService) GetDevicesSummary ¶
func (_d *TracedDeviceService) GetDevicesSummary(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (dp1 *domain.DevicesSummary, s1 domain.Status)
func (*TracedDeviceService) GetRenderedDevice ¶
func (*TracedDeviceService) ListConnectivityChangedDevices ¶
func (_d *TracedDeviceService) ListConnectivityChangedDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, cutoffTime time.Time) (dp1 *domain.DeviceList, s1 domain.Status)
func (*TracedDeviceService) ListDevices ¶
func (_d *TracedDeviceService) ListDevices(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector) (dp1 *domain.DeviceList, s1 domain.Status)
func (*TracedDeviceService) ListDevicesByServiceCondition ¶
func (_d *TracedDeviceService) ListDevicesByServiceCondition(ctx context.Context, orgId uuid.UUID, conditionType string, conditionStatus string, listParams store.ListParams) (dp1 *domain.DeviceList, s1 domain.Status)
func (*TracedDeviceService) ListLabels ¶
func (*TracedDeviceService) MarkDevicesRolloutSelection ¶
func (_d *TracedDeviceService) MarkDevicesRolloutSelection(ctx context.Context, orgId uuid.UUID, params domain.ListDevicesParams, annotationSelector *selector.AnnotationSelector, limit *int) (s1 domain.Status)
func (*TracedDeviceService) OverwriteDeviceRepositoryRefs ¶
func (*TracedDeviceService) PatchDevice ¶
func (*TracedDeviceService) PatchDeviceStatus ¶
func (*TracedDeviceService) ReplaceDevice ¶
func (*TracedDeviceService) ReplaceDeviceSpec ¶
func (*TracedDeviceService) ReplaceDeviceStatus ¶
func (*TracedDeviceService) RestartDeviceApplication ¶
func (*TracedDeviceService) ResumeDevices ¶
func (_d *TracedDeviceService) ResumeDevices(ctx context.Context, orgId uuid.UUID, request domain.DeviceResumeRequest) (d1 domain.DeviceResumeResponse, s1 domain.Status)