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 ProgressorCanceled.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 remainsCanceleduntil 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
QueuedorScheduledtoIn 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-resultmessage containing the sameoperation-idand the result.The instance exchanges messages with Landscape Server again.
Landscape Server receives the
operation-resultand updates the activity’s status toSucceededorFailed.
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-handlerservice 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-handlerencountered 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-handlerconsumes the activity from the queue and moves the activity fromQueuedorScheduledtoIn Progress.The
job-handlercompletes the activity and updates the status toSucceededorFailed.
Types of activities¶
ResynchronizeRequestCreateUserRequestEditUserRequestDeleteUserRequestCreateGroupRequestAddGroupMemberRequestRemoveGroupMemberRequestLockUserRequestUnlockUserRequestChangePackagesRequestUpgradeAllPackagesRequestReleaseUpgradeRequestChangePackageProfilesRequestChangeRepositoryProfilesRequestChangeUpgradeProfilesRequestUpgradeKernelPackageRequestDowngradeKernelPackageRequestSignalProcessRequestExecuteScriptRequestRestartRequestShutdownRequestSyncPocketRequestInstallSnapsRemoveSnapsRefreshSnapsHoldSnapsUnholdSnapsStartChildComputerActivityStopChildComputerActivityDeleteChildComputerActivitySetDefaultChildComputerActivityShutdownHostComputerActivityCreateChildComputerActivityDeleteUnmanagedWSLInstanceActivityArchiveRequestUsgActivityGenerateUsgReportActivityRemoveComputerActivityAttachProRequest