Activities¶
Landscape tracks the progress of various tasks using activities, such as script execution and installing packages. There are two types of activities: client activities and server activities. This document explains how each type of activity is tracked and their possible states.
Client activities¶
Client activities are tasks that execute on Landscape Client. For example, remote script execution. They are processed by the message-system
when an instance exchanges messages with Landscape Server.
Client activity states¶
Activities can start in the Queued
, Scheduled
, Waiting
, or Blocked
states.
Queued
: Activity will run the next time the client exchanges messages. Can transition toIn Progress
,Canceled
, orBlocked
.Scheduled
: Activity will run at a future time. Can transition toIn Progress
orCanceled
.Waiting
: Activity will not run until another activity completes or reaches a progress threshold. Can transition toQueued
,In Progress
, orCanceled
.Blocked
: Activity is paused (often awaiting admin approval). Can transition toQueued
,Canceled
, orWaiting
.In Progress
: Activity has been sent to the client. Can transition toFailed
,Succeeded
, orCanceled
.Failed
: Landscape Client reported an error while executing. This is a final state.Canceled
: Activity was stopped before completion. If the activity was canceled during execution on Landscape Client, it remainsCanceled
until Landscape Client reports the activity result.Succeeded
: Landscape Client reported a successful execution. This is a final state.
Life cycle of a client activity¶
An activity is created for an instance (e.g., by an admin action or scheduled profile).
The instance starts a message exchange with Landscape Server.
Landscape moves the activity from
Queued
orScheduled
toIn Progress
.The activity is sent to the instance as a message containing an
operation-id
.Landscape Client stores the message metadata and calls the corresponding handler to execute the activity.
Once done, Landscape Client creates an
operation-result
message containing the sameoperation-id
and the result.The instance exchanges messages with Landscape Server again.
Landscape Server receives the
operation-result
and updates the activity’s status toSucceeded
orFailed
.
Server activities¶
Server activities run on Landscape Server without interacting with Landscape Client. For example, downloading security profile reports. These activities are placed into a RabbitMQ queue and are processed by the job-handler
service.
Server activity states¶
Activities can start in the Queued
, Scheduled
, Waiting
, or Blocked
states.
Queued
: Activity will run as soon as thejob-handler
service consumes this activity from the queue. Can transition toIn Progress
,Canceled
, orBlocked
.Scheduled
: Activity will run at a future time. Can transition toQueued
,In Progress
, orCanceled
.Waiting
: Activity will not run until another activity completes or reaches a progress threshold. Can transition toQueued
,In Progress
, orCanceled
.Blocked
: Activity is paused (often awaiting admin approval). Can transition toQueued
,Canceled
, orWaiting
.In Progress
: Activity is running on the job handler. Can transition toFailed
,Succeeded
, orCanceled
.Failed
:job-handler
encountered an error while executing the activity. This is a final state.Canceled
: Activity was stopped before completion. This is a final state.Succeeded
: Activity completed successfully. This is a final state.
Life cycle of a server activity¶
An activity is created (e.g., by an admin action or scheduled profile) and added to a RabbitMQ queue.
The
job-handler
consumes the activity from the queue and moves the activity fromQueued
orScheduled
toIn Progress
.The
job-handler
completes the activity and updates the status toSucceeded
orFailed
.
Types of activities¶
ResynchronizeRequest
CreateUserRequest
EditUserRequest
DeleteUserRequest
CreateGroupRequest
AddGroupMemberRequest
RemoveGroupMemberRequest
LockUserRequest
UnlockUserRequest
ChangePackagesRequest
UpgradeAllPackagesRequest
ReleaseUpgradeRequest
ChangePackageProfilesRequest
ChangeRepositoryProfilesRequest
ChangeUpgradeProfilesRequest
UpgradeKernelPackageRequest
DowngradeKernelPackageRequest
SignalProcessRequest
ExecuteScriptRequest
RestartRequest
ShutdownRequest
SyncPocketRequest
InstallSnaps
RemoveSnaps
RefreshSnaps
HoldSnaps
UnholdSnaps
StartChildComputerActivity
StopChildComputerActivity
DeleteChildComputerActivity
SetDefaultChildComputerActivity
ShutdownHostComputerActivity
CreateChildComputerActivity
DeleteUnmanagedWSLInstanceActivity
ArchiveRequest
UsgActivity
GenerateUsgReportActivity
RemoveComputerActivity
AttachProRequest