Device Activities implement a new pattern of interaction between EC and the device that is more resilient and capable to accomplish the work in situations where the connectivity can be intermittent or unstable for a variety of different conditions or when for its nature the nature of the work takes a long execution time.
With Activities the interaction model between EC and the device is asynchronous. Activity submission is not blocking like in classic request/response pattern. EC returns immediately after activity submission and can continue with other tasks; by looking only at the submission step the user does not know if the device has started doing something yet but just that the activity has been sent over the wire. If the submission has been received by the device it will start processing the activity according to its configurations. Thanks to its asynchronous nature there's no need for the device to start the process immediately. Instead the process will be started by the device according to the policies established for the specific operation.
For example, suppose a device is mounted on board of a vehicle. During regular operations it is connected via a constrained/un-reliable mobile connection but it connects to a Wi-Fi during the night hours when it is parked in the depot. For sensitive or complex operations like for example a configuration change or a driver upgrade, it may be convenient to postpone the process until when the vehicle enters the depot and connects to the Wi-Fi.
After submission, the device reports progress of the work (Activity Updates) through sending unsolicited messages on a dedicated channel. The device must sent at least one Activity Update that is the completion message which reports whether the activity has completed successfully or has failed. EC keeps track the submitted activity in order to bind update messages to the original submission and ultimately provide this progress to the user.
EC introduces the concept of Device Activity definition. A definition contains all the information required by the device to start the activity. There are a number of pre-defined activities definition templates that can be instantiated by the user. After the activity has been defined, it is ready be submitted to any device in the fleet. Note that a definition exists independently from the device. Decoupling the activity definition from the device increase the reuse and modularity.
In fact, to submit an activity to a device you need to open the device view, select the device and select the Activity Updates tab then click on the Submit button.
Automated/Massive Submission of Activities
Device activities are integrated with the EC Batch Job framework that allows to submit an activity to a fleet of devices while running un-attended in background.
An Activity Definition is described by the following attributes:
|Name||String||Name that identifies the Activity|
|Description||String||Short description explaining the Activity|
|Device Application||String Enum||Device-side identifier of the application that will receive the submission (e.g. ANSIBLE-V1)|
|Resource URL||URL String||URL of the resource that contains the formal description of the activity to execute (e.g. an Ansible script)|
|Resource URL Authentication||String Enum||Authentication method used to access the Resource|
Currently EC does not provide an endpoint to download the resources required by an activity. Be sure that the resource URL is reachable by the device and the credentials (if any) are valid.
Open the Device Activities view. Press Add button.
Press Submit button to save the activity.
Open the Device Activities view. Select the Activity that you want to edit. Press Edit button.
Press Submit button to save the edits.
Open the Device Activities view. Select the Activity that you want to delete. Press Delete button.
Press Submit button to delete the activity.
Updated over 1 year ago